home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Python 1.1 / Doc / libsun.tex < prev    next >
LaTeX Document  |  1994-01-02  |  4.6 KB  |  [TEXT/R*ch]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: LaTeX Document (document/latex).

You can browse this item here: libsun.tex

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text, with CR line terminators default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[CR] default (weak)


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[R*ch]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 53 55 4e 4f 53 20 4f |\chapter|{SUNOS O|
|00000010| 4e 4c 59 7d 0d 0d 54 68 | 65 20 6d 6f 64 75 6c 65 |NLY}..Th|e module|
|00000020| 73 20 64 65 73 63 72 69 | 62 65 64 20 69 6e 20 74 |s descri|bed in t|
|00000030| 68 69 73 20 63 68 61 70 | 74 65 72 20 70 72 6f 76 |his chap|ter prov|
|00000040| 69 64 65 20 69 6e 74 65 | 72 66 61 63 65 73 20 74 |ide inte|rfaces t|
|00000050| 6f 20 66 65 61 74 75 72 | 65 73 0d 74 68 61 74 20 |o featur|es.that |
|00000060| 61 72 65 20 75 6e 69 71 | 75 65 20 74 6f 20 74 68 |are uniq|ue to th|
|00000070| 65 20 53 75 6e 4f 53 20 | 6f 70 65 72 61 74 69 6e |e SunOS |operatin|
|00000080| 67 20 73 79 73 74 65 6d | 20 28 76 65 72 73 69 6f |g system| (versio|
|00000090| 6e 73 20 34 20 61 6e 64 | 20 35 3b 20 74 68 65 0d |ns 4 and| 5; the.|
|000000a0| 6c 61 74 74 65 72 20 69 | 73 20 61 6c 73 6f 20 6b |latter i|s also k|
|000000b0| 6e 6f 77 6e 20 61 73 20 | 53 4f 4c 41 52 49 53 20 |nown as |SOLARIS |
|000000c0| 76 65 72 73 69 6f 6e 20 | 32 29 2e 0d 0d 5c 73 65 |version |2)...\se|
|000000d0| 63 74 69 6f 6e 7b 42 75 | 69 6c 74 2d 69 6e 20 6d |ction{Bu|ilt-in m|
|000000e0| 6f 64 75 6c 65 20 5c 73 | 65 63 74 63 6f 64 65 7b |odule \s|ectcode{|
|000000f0| 73 75 6e 61 75 64 69 6f | 64 65 76 7d 7d 0d 5c 62 |sunaudio|dev}}.\b|
|00000100| 69 6d 6f 64 69 6e 64 65 | 78 7b 73 75 6e 61 75 64 |imodinde|x{sunaud|
|00000110| 69 6f 64 65 76 7d 0d 0d | 54 68 69 73 20 6d 6f 64 |iodev}..|This mod|
|00000120| 75 6c 65 20 61 6c 6c 6f | 77 73 20 79 6f 75 20 74 |ule allo|ws you t|
|00000130| 6f 20 61 63 63 65 73 73 | 20 74 68 65 20 73 75 6e |o access| the sun|
|00000140| 20 61 75 64 69 6f 20 69 | 6e 74 65 72 66 61 63 65 | audio i|nterface|
|00000150| 2e 20 54 68 65 20 73 75 | 6e 0d 61 75 64 69 6f 20 |. The su|n.audio |
|00000160| 68 61 72 64 77 61 72 65 | 20 69 73 20 63 61 70 61 |hardware| is capa|
|00000170| 62 6c 65 20 6f 66 20 72 | 65 63 6f 72 64 69 6e 67 |ble of r|ecording|
|00000180| 20 61 6e 64 20 70 6c 61 | 79 69 6e 67 20 62 61 63 | and pla|ying bac|
|00000190| 6b 20 61 75 64 69 6f 20 | 64 61 74 61 0d 69 6e 20 |k audio |data.in |
|000001a0| 55 2d 4c 41 57 20 66 6f | 72 6d 61 74 20 77 69 74 |U-LAW fo|rmat wit|
|000001b0| 68 20 61 20 73 61 6d 70 | 6c 65 20 72 61 74 65 20 |h a samp|le rate |
|000001c0| 6f 66 20 38 4b 20 70 65 | 72 20 73 65 63 6f 6e 64 |of 8K pe|r second|
|000001d0| 2e 20 41 20 66 75 6c 6c | 0d 64 65 73 63 72 69 70 |. A full|.descrip|
|000001e0| 74 69 6f 6e 20 63 61 6e | 20 62 65 20 67 6f 74 74 |tion can| be gott|
|000001f0| 65 6e 20 77 69 74 68 20 | 5c 73 61 6d 70 7b 6d 61 |en with |\samp{ma|
|00000200| 6e 20 61 75 64 69 6f 7d | 2e 0d 0d 54 68 65 20 6d |n audio}|...The m|
|00000210| 6f 64 75 6c 65 20 64 65 | 66 69 6e 65 73 20 74 68 |odule de|fines th|
|00000220| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 76 61 72 69 |e follow|ing vari|
|00000230| 61 62 6c 65 73 20 61 6e | 64 20 66 75 6e 63 74 69 |ables an|d functi|
|00000240| 6f 6e 73 3a 0d 0d 5c 72 | 65 6e 65 77 63 6f 6d 6d |ons:..\r|enewcomm|
|00000250| 61 6e 64 7b 5c 69 6e 64 | 65 78 73 75 62 69 74 65 |and{\ind|exsubite|
|00000260| 6d 7d 7b 28 69 6e 20 6d | 6f 64 75 6c 65 20 73 75 |m}{(in m|odule su|
|00000270| 6e 61 75 64 69 6f 64 65 | 76 29 7d 0d 5c 62 65 67 |naudiode|v)}.\beg|
|00000280| 69 6e 7b 65 78 63 64 65 | 73 63 7d 7b 65 72 72 6f |in{excde|sc}{erro|
|00000290| 72 7d 0d 54 68 69 73 20 | 65 78 63 65 70 74 69 6f |r}.This |exceptio|
|000002a0| 6e 20 69 73 20 72 61 69 | 73 65 64 20 6f 6e 20 61 |n is rai|sed on a|
|000002b0| 6c 6c 20 65 72 72 6f 72 | 73 2e 20 54 68 65 20 61 |ll error|s. The a|
|000002c0| 72 67 75 6d 65 6e 74 20 | 69 73 20 61 20 73 74 72 |rgument |is a str|
|000002d0| 69 6e 67 0d 64 65 73 63 | 72 69 62 69 6e 67 20 77 |ing.desc|ribing w|
|000002e0| 68 61 74 20 77 65 6e 74 | 20 77 72 6f 6e 67 2e 0d |hat went| wrong..|
|000002f0| 5c 65 6e 64 7b 65 78 63 | 64 65 73 63 7d 0d 0d 5c |\end{exc|desc}..\|
|00000300| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00000310| 6f 70 65 6e 7d 7b 6d 6f | 64 65 7d 0d 54 68 69 73 |open}{mo|de}.This|
|00000320| 20 66 75 6e 63 74 69 6f | 6e 20 6f 70 65 6e 73 20 | functio|n opens |
|00000330| 74 68 65 20 61 75 64 69 | 6f 20 64 65 76 69 63 65 |the audi|o device|
|00000340| 20 61 6e 64 20 72 65 74 | 75 72 6e 73 20 61 20 73 | and ret|urns a s|
|00000350| 75 6e 20 61 75 64 69 6f | 20 64 65 76 69 63 65 0d |un audio| device.|
|00000360| 6f 62 6a 65 63 74 2e 20 | 54 68 69 73 20 6f 62 6a |object. |This obj|
|00000370| 65 63 74 20 63 61 6e 20 | 74 68 65 6e 20 62 65 20 |ect can |then be |
|00000380| 75 73 65 64 20 74 6f 20 | 64 6f 20 49 2f 4f 20 6f |used to |do I/O o|
|00000390| 6e 2e 20 54 68 65 20 5c | 76 61 72 7b 6d 6f 64 65 |n. The \|var{mode|
|000003a0| 7d 20 70 61 72 61 6d 65 | 74 65 72 0d 69 73 20 6f |} parame|ter.is o|
|000003b0| 6e 65 20 6f 66 20 5c 63 | 6f 64 65 7b 27 72 27 7d |ne of \c|ode{'r'}|
|000003c0| 20 66 6f 72 20 72 65 63 | 6f 72 64 2d 6f 6e 6c 79 | for rec|ord-only|
|000003d0| 20 61 63 63 65 73 73 2c | 20 5c 63 6f 64 65 7b 27 | access,| \code{'|
|000003e0| 77 27 7d 20 66 6f 72 20 | 70 6c 61 79 2d 6f 6e 6c |w'} for |play-onl|
|000003f0| 79 0d 61 63 63 65 73 73 | 2c 20 5c 63 6f 64 65 7b |y.access|, \code{|
|00000400| 27 72 77 27 7d 20 66 6f | 72 20 62 6f 74 68 20 61 |'rw'} fo|r both a|
|00000410| 6e 64 20 5c 63 6f 64 65 | 7b 27 63 6f 6e 74 72 6f |nd \code|{'contro|
|00000420| 6c 27 7d 20 66 6f 72 20 | 61 63 63 65 73 73 20 74 |l'} for |access t|
|00000430| 6f 20 74 68 65 0d 63 6f | 6e 74 72 6f 6c 20 64 65 |o the.co|ntrol de|
|00000440| 76 69 63 65 2e 20 53 69 | 6e 63 65 20 6f 6e 6c 79 |vice. Si|nce only|
|00000450| 20 6f 6e 65 20 70 72 6f | 63 65 73 73 20 69 73 20 | one pro|cess is |
|00000460| 61 6c 6c 6f 77 65 64 20 | 74 6f 20 68 61 76 65 20 |allowed |to have |
|00000470| 74 68 65 20 72 65 63 6f | 72 64 65 72 0d 6f 72 20 |the reco|rder.or |
|00000480| 70 6c 61 79 65 72 20 6f | 70 65 6e 20 61 74 20 74 |player o|pen at t|
|00000490| 68 65 20 73 61 6d 65 20 | 74 69 6d 65 20 69 74 20 |he same |time it |
|000004a0| 69 73 20 61 20 67 6f 6f | 64 20 69 64 65 61 20 74 |is a goo|d idea t|
|000004b0| 6f 20 6f 70 65 6e 20 74 | 68 65 20 64 65 76 69 63 |o open t|he devic|
|000004c0| 65 0d 6f 6e 6c 79 20 66 | 6f 72 20 74 68 65 20 61 |e.only f|or the a|
|000004d0| 63 74 69 76 69 74 79 20 | 6e 65 65 64 65 64 2e 20 |ctivity |needed. |
|000004e0| 53 65 65 20 74 68 65 20 | 61 75 64 69 6f 20 6d 61 |See the |audio ma|
|000004f0| 6e 70 61 67 65 20 66 6f | 72 20 64 65 74 61 69 6c |npage fo|r detail|
|00000500| 73 2e 0d 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |s..\end{|funcdesc|
|00000510| 7d 0d 0d 5c 73 75 62 73 | 65 63 74 69 6f 6e 7b 41 |}..\subs|ection{A|
|00000520| 75 64 69 6f 20 64 65 76 | 69 63 65 20 6f 62 6a 65 |udio dev|ice obje|
|00000530| 63 74 20 6d 65 74 68 6f | 64 73 7d 0d 0d 54 68 65 |ct metho|ds}..The|
|00000540| 20 61 75 64 69 6f 20 64 | 65 76 69 63 65 20 6f 62 | audio d|evice ob|
|00000550| 6a 65 63 74 73 20 61 72 | 65 20 72 65 74 75 72 6e |jects ar|e return|
|00000560| 65 64 20 62 79 20 5c 63 | 6f 64 65 7b 6f 70 65 6e |ed by \c|ode{open|
|00000570| 7d 20 64 65 66 69 6e 65 | 20 74 68 65 0d 66 6f 6c |} define| the.fol|
|00000580| 6c 6f 77 69 6e 67 20 6d | 65 74 68 6f 64 73 20 28 |lowing m|ethods (|
|00000590| 65 78 63 65 70 74 20 5c | 63 6f 64 65 7b 63 6f 6e |except \|code{con|
|000005a0| 74 72 6f 6c 7d 20 6f 62 | 6a 65 63 74 73 20 77 68 |trol} ob|jects wh|
|000005b0| 69 63 68 20 6f 6e 6c 79 | 20 70 72 6f 76 69 64 65 |ich only| provide|
|000005c0| 0d 67 65 74 69 6e 66 6f | 2c 20 73 65 74 69 6e 66 |.getinfo|, setinf|
|000005d0| 6f 20 61 6e 64 20 64 72 | 61 69 6e 29 3a 0d 0d 5c |o and dr|ain):..\|
|000005e0| 72 65 6e 65 77 63 6f 6d | 6d 61 6e 64 7b 5c 69 6e |renewcom|mand{\in|
|000005f0| 64 65 78 73 75 62 69 74 | 65 6d 7d 7b 28 61 75 64 |dexsubit|em}{(aud|
|00000600| 69 6f 20 64 65 76 69 63 | 65 20 6d 65 74 68 6f 64 |io devic|e method|
|00000610| 29 7d 0d 0d 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |)}..\beg|in{funcd|
|00000620| 65 73 63 7d 7b 63 6c 6f | 73 65 7d 7b 7d 0d 54 68 |esc}{clo|se}{}.Th|
|00000630| 69 73 20 6d 65 74 68 6f | 64 20 65 78 70 6c 69 63 |is metho|d explic|
|00000640| 69 74 6c 79 20 63 6c 6f | 73 65 73 20 74 68 65 20 |itly clo|ses the |
|00000650| 64 65 76 69 63 65 2e 20 | 49 74 20 69 73 20 75 73 |device. |It is us|
|00000660| 65 66 75 6c 20 69 6e 20 | 73 69 74 75 61 74 69 6f |eful in |situatio|
|00000670| 6e 73 0d 77 68 65 72 65 | 20 64 65 6c 65 74 69 6e |ns.where| deletin|
|00000680| 67 20 74 68 65 20 6f 62 | 6a 65 63 74 20 64 6f 65 |g the ob|ject doe|
|00000690| 73 20 6e 6f 74 20 69 6d | 6d 65 64 69 61 74 65 6c |s not im|mediatel|
|000006a0| 79 20 63 6c 6f 73 65 20 | 69 74 20 73 69 6e 63 65 |y close |it since|
|000006b0| 20 74 68 65 72 65 0d 61 | 72 65 20 6f 74 68 65 72 | there.a|re other|
|000006c0| 20 72 65 66 65 72 65 6e | 63 65 73 20 74 6f 20 69 | referen|ces to i|
|000006d0| 74 2e 20 41 20 63 6c 6f | 73 65 64 20 64 65 76 69 |t. A clo|sed devi|
|000006e0| 63 65 20 73 68 6f 75 6c | 64 20 6e 6f 74 20 62 65 |ce shoul|d not be|
|000006f0| 20 75 73 65 64 20 61 67 | 61 69 6e 2e 0d 5c 65 6e | used ag|ain..\en|
|00000700| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|00000710| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 64 72 |gin{func|desc}{dr|
|00000720| 61 69 6e 7d 7b 7d 0d 54 | 68 69 73 20 6d 65 74 68 |ain}{}.T|his meth|
|00000730| 6f 64 20 77 61 69 74 73 | 20 75 6e 74 69 6c 20 61 |od waits| until a|
|00000740| 6c 6c 20 70 65 6e 64 69 | 6e 67 20 6f 75 74 70 75 |ll pendi|ng outpu|
|00000750| 74 20 69 73 20 70 72 6f | 63 65 73 73 65 64 20 61 |t is pro|cessed a|
|00000760| 6e 64 20 74 68 65 6e 20 | 72 65 74 75 72 6e 73 2e |nd then |returns.|
|00000770| 0d 43 61 6c 6c 69 6e 67 | 20 74 68 69 73 20 6d 65 |.Calling| this me|
|00000780| 74 68 6f 64 20 69 73 20 | 6f 66 74 65 6e 20 6e 6f |thod is |often no|
|00000790| 74 20 6e 65 63 65 73 73 | 61 72 79 3a 20 64 65 73 |t necess|ary: des|
|000007a0| 74 72 6f 79 69 6e 67 20 | 74 68 65 20 6f 62 6a 65 |troying |the obje|
|000007b0| 63 74 20 77 69 6c 6c 0d | 61 75 74 6f 6d 61 74 69 |ct will.|automati|
|000007c0| 63 61 6c 6c 79 20 63 6c | 6f 73 65 20 74 68 65 20 |cally cl|ose the |
|000007d0| 61 75 64 69 6f 20 64 65 | 76 69 63 65 20 61 6e 64 |audio de|vice and|
|000007e0| 20 74 68 69 73 20 77 69 | 6c 6c 20 64 6f 20 61 6e | this wi|ll do an|
|000007f0| 20 69 6d 70 6c 69 63 69 | 74 20 64 72 61 69 6e 2e | implici|t drain.|
|00000800| 0d 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0d |.\end{fu|ncdesc}.|
|00000810| 0d 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00000820| 7d 7b 66 6c 75 73 68 7d | 7b 7d 0d 54 68 69 73 20 |}{flush}|{}.This |
|00000830| 6d 65 74 68 6f 64 20 64 | 69 73 63 61 72 64 73 20 |method d|iscards |
|00000840| 61 6c 6c 20 70 65 6e 64 | 69 6e 67 20 6f 75 74 70 |all pend|ing outp|
|00000850| 75 74 2e 20 49 74 20 63 | 61 6e 20 62 65 20 75 73 |ut. It c|an be us|
|00000860| 65 64 20 61 76 6f 69 64 | 20 74 68 65 0d 73 6c 6f |ed avoid| the.slo|
|00000870| 77 20 72 65 73 70 6f 6e | 73 65 20 74 6f 20 61 20 |w respon|se to a |
|00000880| 75 73 65 72 27 73 20 73 | 74 6f 70 20 72 65 71 75 |user's s|top requ|
|00000890| 65 73 74 20 28 64 75 65 | 20 74 6f 20 62 75 66 66 |est (due| to buff|
|000008a0| 65 72 69 6e 67 20 6f 66 | 20 75 70 20 74 6f 20 6f |ering of| up to o|
|000008b0| 6e 65 0d 73 65 63 6f 6e | 64 20 6f 66 20 73 6f 75 |ne.secon|d of sou|
|000008c0| 6e 64 29 2e 0d 5c 65 6e | 64 7b 66 75 6e 63 64 65 |nd)..\en|d{funcde|
|000008d0| 73 63 7d 0d 0d 5c 62 65 | 67 69 6e 7b 66 75 6e 63 |sc}..\be|gin{func|
|000008e0| 64 65 73 63 7d 7b 67 65 | 74 69 6e 66 6f 7d 7b 7d |desc}{ge|tinfo}{}|
|000008f0| 0d 54 68 69 73 20 6d 65 | 74 68 6f 64 20 72 65 74 |.This me|thod ret|
|00000900| 72 69 65 76 65 73 20 73 | 74 61 74 75 73 20 69 6e |rieves s|tatus in|
|00000910| 66 6f 72 6d 61 74 69 6f | 6e 20 6c 69 6b 65 20 69 |formatio|n like i|
|00000920| 6e 70 75 74 20 61 6e 64 | 20 6f 75 74 70 75 74 20 |nput and| output |
|00000930| 76 6f 6c 75 6d 65 2c 0d | 65 74 63 2e 20 61 6e 64 |volume,.|etc. and|
|00000940| 20 72 65 74 75 72 6e 73 | 20 69 74 20 69 6e 20 74 | returns| it in t|
|00000950| 68 65 20 66 6f 72 6d 20 | 6f 66 0d 61 6e 20 61 75 |he form |of.an au|
|00000960| 64 69 6f 20 73 74 61 74 | 75 73 20 6f 62 6a 65 63 |dio stat|us objec|
|00000970| 74 2e 20 54 68 69 73 20 | 6f 62 6a 65 63 74 20 68 |t. This |object h|
|00000980| 61 73 20 6e 6f 20 6d 65 | 74 68 6f 64 73 20 62 75 |as no me|thods bu|
|00000990| 74 20 69 74 20 63 6f 6e | 74 61 69 6e 73 20 61 0d |t it con|tains a.|
|000009a0| 6e 75 6d 62 65 72 20 6f | 66 20 61 74 74 72 69 62 |number o|f attrib|
|000009b0| 75 74 65 73 20 64 65 73 | 63 72 69 62 69 6e 67 20 |utes des|cribing |
|000009c0| 74 68 65 20 63 75 72 72 | 65 6e 74 20 64 65 76 69 |the curr|ent devi|
|000009d0| 63 65 20 73 74 61 74 75 | 73 2e 20 54 68 65 20 6e |ce statu|s. The n|
|000009e0| 61 6d 65 73 0d 61 6e 64 | 20 6d 65 61 6e 69 6e 67 |ames.and| meaning|
|000009f0| 73 20 6f 66 20 74 68 65 | 20 61 74 74 72 69 62 75 |s of the| attribu|
|00000a00| 74 65 73 20 61 72 65 20 | 64 65 73 63 72 69 62 65 |tes are |describe|
|00000a10| 64 20 69 6e 0d 5c 66 69 | 6c 65 7b 2f 75 73 72 2f |d in.\fi|le{/usr/|
|00000a20| 69 6e 63 6c 75 64 65 2f | 73 75 6e 2f 61 75 64 69 |include/|sun/audi|
|00000a30| 6f 69 6f 2e 68 7d 20 61 | 6e 64 20 69 6e 20 74 68 |oio.h} a|nd in th|
|00000a40| 65 20 61 75 64 69 6f 20 | 6d 61 6e 20 70 61 67 65 |e audio |man page|
|00000a50| 2e 20 4d 65 6d 62 65 72 | 20 6e 61 6d 65 73 0d 61 |. Member| names.a|
|00000a60| 72 65 20 73 6c 69 67 68 | 74 6c 79 20 64 69 66 66 |re sligh|tly diff|
|00000a70| 65 72 65 6e 74 20 66 72 | 6f 6d 20 74 68 65 69 72 |erent fr|om their|
|00000a80| 20 43 20 63 6f 75 6e 74 | 65 72 70 61 72 74 73 3a | C count|erparts:|
|00000a90| 20 61 20 73 74 61 74 75 | 73 20 6f 62 6a 65 63 74 | a statu|s object|
|00000aa0| 20 69 73 0d 6f 6e 6c 79 | 20 61 20 73 69 6e 67 6c | is.only| a singl|
|00000ab0| 65 20 73 74 72 75 63 74 | 75 72 65 2e 20 4d 65 6d |e struct|ure. Mem|
|00000ac0| 62 65 72 73 20 6f 66 20 | 74 68 65 20 5c 63 6f 64 |bers of |the \cod|
|00000ad0| 65 7b 70 6c 61 79 7d 20 | 73 75 62 73 74 72 75 63 |e{play} |substruc|
|00000ae0| 74 75 72 65 20 68 61 76 | 65 0d 5c 73 61 6d 70 7b |ture hav|e.\samp{|
|00000af0| 6f 5f 7d 20 70 72 65 70 | 65 6e 64 65 64 20 74 6f |o_} prep|ended to|
|00000b00| 20 74 68 65 69 72 20 6e | 61 6d 65 20 61 6e 64 20 | their n|ame and |
|00000b10| 6d 65 6d 62 65 72 73 20 | 6f 66 20 74 68 65 20 5c |members |of the \|
|00000b20| 63 6f 64 65 7b 72 65 63 | 6f 72 64 7d 0d 73 74 72 |code{rec|ord}.str|
|00000b30| 75 63 74 75 72 65 20 68 | 61 76 65 20 5c 73 61 6d |ucture h|ave \sam|
|00000b40| 70 7b 69 5f 7d 2e 20 53 | 6f 2c 20 74 68 65 20 43 |p{i_}. S|o, the C|
|00000b50| 20 6d 65 6d 62 65 72 20 | 5c 63 6f 64 65 7b 70 6c | member |\code{pl|
|00000b60| 61 79 2e 73 61 6d 70 6c | 65 5f 72 61 74 65 7d 20 |ay.sampl|e_rate} |
|00000b70| 69 73 0d 61 63 63 65 73 | 73 65 64 20 61 73 20 5c |is.acces|sed as \|
|00000b80| 63 6f 64 65 7b 6f 5f 73 | 61 6d 70 6c 65 5f 72 61 |code{o_s|ample_ra|
|00000b90| 74 65 7d 2c 20 5c 63 6f | 64 65 7b 72 65 63 6f 72 |te}, \co|de{recor|
|00000ba0| 64 2e 67 61 69 6e 7d 20 | 61 73 20 5c 63 6f 64 65 |d.gain} |as \code|
|00000bb0| 7b 69 5f 67 61 69 6e 7d | 0d 61 6e 64 20 5c 63 6f |{i_gain}|.and \co|
|00000bc0| 64 65 7b 6d 6f 6e 69 74 | 6f 72 5f 67 61 69 6e 7d |de{monit|or_gain}|
|00000bd0| 20 70 6c 61 69 6e 6c 79 | 20 61 73 20 5c 63 6f 64 | plainly| as \cod|
|00000be0| 65 7b 6d 6f 6e 69 74 6f | 72 5f 67 61 69 6e 7d 2e |e{monito|r_gain}.|
|00000bf0| 0d 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0d |.\end{fu|ncdesc}.|
|00000c00| 0d 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00000c10| 7d 7b 69 62 75 66 63 6f | 75 6e 74 7d 7b 7d 0d 54 |}{ibufco|unt}{}.T|
|00000c20| 68 69 73 20 6d 65 74 68 | 6f 64 20 72 65 74 75 72 |his meth|od retur|
|00000c30| 6e 73 20 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |ns the n|umber of|
|00000c40| 20 73 61 6d 70 6c 65 73 | 20 74 68 61 74 20 61 72 | samples| that ar|
|00000c50| 65 20 62 75 66 66 65 72 | 65 64 20 6f 6e 20 74 68 |e buffer|ed on th|
|00000c60| 65 0d 72 65 63 6f 72 64 | 69 6e 67 20 73 69 64 65 |e.record|ing side|
|00000c70| 2c 20 69 2e 65 2e 0d 74 | 68 65 20 70 72 6f 67 72 |, i.e..t|he progr|
|00000c80| 61 6d 20 77 69 6c 6c 20 | 6e 6f 74 20 62 6c 6f 63 |am will |not bloc|
|00000c90| 6b 20 6f 6e 20 61 20 5c | 63 6f 64 65 7b 72 65 61 |k on a \|code{rea|
|00000ca0| 64 7d 20 63 61 6c 6c 20 | 6f 66 20 73 6f 20 6d 61 |d} call |of so ma|
|00000cb0| 6e 79 20 73 61 6d 70 6c | 65 73 2e 0d 5c 65 6e 64 |ny sampl|es..\end|
|00000cc0| 7b 66 75 6e 63 64 65 73 | 63 7d 0d 0d 5c 62 65 67 |{funcdes|c}..\beg|
|00000cd0| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 6f 62 75 |in{funcd|esc}{obu|
|00000ce0| 66 63 6f 75 6e 74 7d 7b | 7d 0d 54 68 69 73 20 6d |fcount}{|}.This m|
|00000cf0| 65 74 68 6f 64 20 72 65 | 74 75 72 6e 73 20 74 68 |ethod re|turns th|
|00000d00| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 73 61 6d 70 |e number| of samp|
|00000d10| 6c 65 73 20 62 75 66 66 | 65 72 65 64 20 6f 6e 20 |les buff|ered on |
|00000d20| 74 68 65 20 70 6c 61 79 | 62 61 63 6b 0d 73 69 64 |the play|back.sid|
|00000d30| 65 2e 20 55 6e 66 6f 72 | 74 75 6e 61 74 65 6c 79 |e. Unfor|tunately|
|00000d40| 2c 20 74 68 69 73 20 6e | 75 6d 62 65 72 20 63 61 |, this n|umber ca|
|00000d50| 6e 6e 6f 74 20 62 65 20 | 75 73 65 64 20 74 6f 20 |nnot be |used to |
|00000d60| 64 65 74 65 72 6d 69 6e | 65 20 61 20 6e 75 6d 62 |determin|e a numb|
|00000d70| 65 72 0d 6f 66 20 73 61 | 6d 70 6c 65 73 20 74 68 |er.of sa|mples th|
|00000d80| 61 74 20 63 61 6e 20 62 | 65 20 77 72 69 74 74 65 |at can b|e writte|
|00000d90| 6e 20 77 69 74 68 6f 75 | 74 20 62 6c 6f 63 6b 69 |n withou|t blocki|
|00000da0| 6e 67 20 73 69 6e 63 65 | 20 74 68 65 20 6b 65 72 |ng since| the ker|
|00000db0| 6e 65 6c 0d 6f 75 74 70 | 75 74 20 71 75 65 75 65 |nel.outp|ut queue|
|00000dc0| 20 6c 65 6e 67 74 68 20 | 73 65 65 6d 73 20 74 6f | length |seems to|
|00000dd0| 20 62 65 20 76 61 72 69 | 61 62 6c 65 2e 0d 5c 65 | be vari|able..\e|
|00000de0| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0d 0d 5c 62 |nd{funcd|esc}..\b|
|00000df0| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 72 |egin{fun|cdesc}{r|
|00000e00| 65 61 64 7d 7b 73 69 7a | 65 7d 0d 54 68 69 73 20 |ead}{siz|e}.This |
|00000e10| 6d 65 74 68 6f 64 20 72 | 65 61 64 73 20 5c 76 61 |method r|eads \va|
|00000e20| 72 7b 73 69 7a 65 7d 20 | 73 61 6d 70 6c 65 73 20 |r{size} |samples |
|00000e30| 66 72 6f 6d 20 74 68 65 | 20 61 75 64 69 6f 20 69 |from the| audio i|
|00000e40| 6e 70 75 74 20 61 6e 64 | 20 72 65 74 75 72 6e 73 |nput and| returns|
|00000e50| 0d 74 68 65 6d 20 61 73 | 20 61 20 70 79 74 68 6f |.them as| a pytho|
|00000e60| 6e 20 73 74 72 69 6e 67 | 2e 20 54 68 65 20 66 75 |n string|. The fu|
|00000e70| 6e 63 74 69 6f 6e 20 62 | 6c 6f 63 6b 73 20 75 6e |nction b|locks un|
|00000e80| 74 69 6c 20 65 6e 6f 75 | 67 68 20 64 61 74 61 20 |til enou|gh data |
|00000e90| 69 73 20 61 76 61 69 6c | 61 62 6c 65 2e 0d 5c 65 |is avail|able..\e|
|00000ea0| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0d 0d 5c 62 |nd{funcd|esc}..\b|
|00000eb0| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 73 |egin{fun|cdesc}{s|
|00000ec0| 65 74 69 6e 66 6f 7d 7b | 73 74 61 74 75 73 7d 0d |etinfo}{|status}.|
|00000ed0| 54 68 69 73 20 6d 65 74 | 68 6f 64 20 73 65 74 73 |This met|hod sets|
|00000ee0| 20 74 68 65 20 61 75 64 | 69 6f 20 64 65 76 69 63 | the aud|io devic|
|00000ef0| 65 20 73 74 61 74 75 73 | 20 70 61 72 61 6d 65 74 |e status| paramet|
|00000f00| 65 72 73 2e 20 54 68 65 | 20 5c 76 61 72 7b 73 74 |ers. The| \var{st|
|00000f10| 61 74 75 73 7d 0d 70 61 | 72 61 6d 65 74 65 72 20 |atus}.pa|rameter |
|00000f20| 69 73 20 61 6e 20 64 65 | 76 69 63 65 20 73 74 61 |is an de|vice sta|
|00000f30| 74 75 73 20 6f 62 6a 65 | 63 74 20 61 73 20 72 65 |tus obje|ct as re|
|00000f40| 74 75 72 6e 65 64 20 62 | 79 20 5c 63 6f 64 65 7b |turned b|y \code{|
|00000f50| 67 65 74 69 6e 66 6f 7d | 20 61 6e 64 0d 70 6f 73 |getinfo}| and.pos|
|00000f60| 73 69 62 6c 79 20 6d 6f | 64 69 66 69 65 64 20 62 |sibly mo|dified b|
|00000f70| 79 20 74 68 65 20 70 72 | 6f 67 72 61 6d 2e 0d 5c |y the pr|ogram..\|
|00000f80| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0d 0d 5c |end{func|desc}..\|
|00000f90| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00000fa0| 77 72 69 74 65 7d 7b 73 | 61 6d 70 6c 65 73 7d 0d |write}{s|amples}.|
|00000fb0| 57 72 69 74 65 20 69 73 | 20 70 61 73 73 65 64 20 |Write is| passed |
|00000fc0| 61 20 70 79 74 68 6f 6e | 20 73 74 72 69 6e 67 20 |a python| string |
|00000fd0| 63 6f 6e 74 61 69 6e 69 | 6e 67 20 61 75 64 69 6f |containi|ng audio|
|00000fe0| 20 73 61 6d 70 6c 65 73 | 20 74 6f 20 62 65 20 70 | samples| to be p|
|00000ff0| 6c 61 79 65 64 2e 0d 49 | 66 20 74 68 65 72 65 20 |layed..I|f there |
|00001000| 69 73 20 65 6e 6f 75 67 | 68 20 62 75 66 66 65 72 |is enoug|h buffer|
|00001010| 20 73 70 61 63 65 20 66 | 72 65 65 20 69 74 20 77 | space f|ree it w|
|00001020| 69 6c 6c 20 69 6d 6d 65 | 64 65 61 74 65 6c 79 20 |ill imme|deately |
|00001030| 72 65 74 75 72 6e 2c 0d | 6f 74 68 65 72 77 69 73 |return,.|otherwis|
|00001040| 65 20 69 74 20 77 69 6c | 6c 20 62 6c 6f 63 6b 2e |e it wil|l block.|
|00001050| 0d 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0d |.\end{fu|ncdesc}.|
|00001060| 0d 54 68 65 72 65 20 69 | 73 20 61 20 63 6f 6d 70 |.There i|s a comp|
|00001070| 61 6e 69 6f 6e 20 6d 6f | 64 75 6c 65 2c 20 5c 63 |anion mo|dule, \c|
|00001080| 6f 64 65 7b 53 55 4e 41 | 55 44 49 4f 44 45 56 7d |ode{SUNA|UDIODEV}|
|00001090| 2c 20 77 68 69 63 68 20 | 64 65 66 69 6e 65 73 20 |, which |defines |
|000010a0| 75 73 65 66 75 6c 0d 73 | 79 6d 62 6f 6c 69 63 20 |useful.s|ymbolic |
|000010b0| 63 6f 6e 73 74 61 6e 74 | 73 20 6c 69 6b 65 20 5c |constant|s like \|
|000010c0| 63 6f 64 65 7b 4d 49 4e | 5f 47 41 49 4e 7d 2c 20 |code{MIN|_GAIN}, |
|000010d0| 5c 63 6f 64 65 7b 4d 41 | 58 5f 47 41 49 4e 7d 2c |\code{MA|X_GAIN},|
|000010e0| 0d 5c 63 6f 64 65 7b 53 | 50 45 41 4b 45 52 7d 2c |.\code{S|PEAKER},|
|000010f0| 20 65 74 63 2e 20 54 68 | 65 20 6e 61 6d 65 73 20 | etc. Th|e names |
|00001100| 6f 66 0d 74 68 65 20 63 | 6f 6e 73 74 61 6e 74 73 |of.the c|onstants|
|00001110| 20 61 72 65 20 74 68 65 | 20 73 61 6d 65 20 6e 61 | are the| same na|
|00001120| 6d 65 73 20 61 73 20 75 | 73 65 64 20 69 6e 20 74 |mes as u|sed in t|
|00001130| 68 65 20 43 20 69 6e 63 | 6c 75 64 65 20 66 69 6c |he C inc|lude fil|
|00001140| 65 0d 5c 66 69 6c 65 7b | 3c 73 75 6e 2f 61 75 64 |e.\file{|<sun/aud|
|00001150| 69 6f 69 6f 2e 68 3e 7d | 2c 20 77 69 74 68 20 74 |ioio.h>}|, with t|
|00001160| 68 65 20 6c 65 61 64 69 | 6e 67 20 73 74 72 69 6e |he leadi|ng strin|
|00001170| 67 20 5c 73 61 6d 70 7b | 41 55 44 49 4f 5f 7d 20 |g \samp{|AUDIO_} |
|00001180| 73 74 72 69 70 70 65 64 | 2e 0d 0d 55 73 65 61 62 |stripped|...Useab|
|00001190| 69 6c 69 74 79 20 6f 66 | 20 74 68 65 20 63 6f 6e |ility of| the con|
|000011a0| 74 72 6f 6c 20 64 65 76 | 69 63 65 20 69 73 20 6c |trol dev|ice is l|
|000011b0| 69 6d 69 74 65 64 20 61 | 74 20 74 68 65 20 6d 6f |imited a|t the mo|
|000011c0| 6d 65 6e 74 2c 20 73 69 | 6e 63 65 20 74 68 65 72 |ment, si|nce ther|
|000011d0| 65 0d 69 73 20 6e 6f 20 | 77 61 79 20 74 6f 20 75 |e.is no |way to u|
|000011e0| 73 65 20 74 68 65 20 27 | 77 61 69 74 20 66 6f 72 |se the '|wait for|
|000011f0| 20 73 6f 6d 65 74 68 69 | 6e 67 20 74 6f 20 68 61 | somethi|ng to ha|
|00001200| 70 70 65 6e 27 20 66 65 | 61 74 75 72 65 20 74 68 |ppen' fe|ature th|
|00001210| 65 20 64 65 76 69 63 65 | 0d 70 72 6f 76 69 64 65 |e device|.provide|
|00001220| 73 2e 20 54 68 69 73 20 | 69 73 20 62 65 63 61 75 |s. This |is becau|
|00001230| 73 65 20 74 68 61 74 20 | 66 65 61 74 75 72 65 20 |se that |feature |
|00001240| 6d 61 6b 65 73 20 68 65 | 61 76 79 20 75 73 65 20 |makes he|avy use |
|00001250| 6f 66 20 73 69 67 6e 61 | 6c 73 2c 20 61 6e 64 0d |of signa|ls, and.|
|00001260| 74 68 65 73 65 20 64 6f | 20 6e 6f 74 20 6d 61 70 |these do| not map|
|00001270| 20 74 6f 6f 20 77 65 6c | 6c 20 6f 6e 74 6f 20 50 | too wel|l onto P|
|00001280| 79 74 68 6f 6e 2e 0d | |ython.. | |
+--------+-------------------------+-------------------------+--------+--------+