Module pyaudio
[show private | hide private]
[frames | no frames]

Module pyaudio

pyAudio : Python Bindings for PortAudio v19.

These bindings only support PortAudio blocking mode.


Classes
PyAudio initialize and terminate PortAudio
Stream PortAudio Stream Wrapper.

Function Summary
    Stream Conversion Convenience Functions

int

get_sample_size(format)
Returns the size (in bytes) for the specified sample format (a PaSampleFormat constant).

PaSampleFormat

get_format_from_width(width, unsigned)
Returns a PortAudio format constant for the specified width.
    PortAudio version

str

get_portaudio_version()
Returns portaudio version.

str

get_portaudio_version_text()
Returns PortAudio version as a text string.

Variable Summary
str __author__ = 'Hubert Pham'
str __version__ = '0.1.0'
str __revision__ = '$Revision: 6 $'
    PortAudio Constants
list PaSampleFormat: A list of all PortAudio PaSampleFormat value constants.
list PaHostApiTypeId: A list of all PortAudio PaHostApiTypeId constants.
list PaErrorCode: A list of all PortAudio PaErrorCode constants.
    PaSampleFormat Values
int paFloat32 = 1                                                                     
int paInt32 = 2                                                                     
int paInt24 = 4                                                                     
int paInt16 = 8                                                                     
int paInt8 = 16                                                                    
int paUInt8 = 32                                                                    
int paCustomFormat = 65536                                                                 
    PaHostApiTypeId Values
int paInDevelopment = 0                                                                     
int paDirectSound = 1                                                                     
int paMME = 2                                                                     
int paASIO = 3                                                                     
int paSoundManager = 4                                                                     
int paCoreAudio = 5                                                                     
int paOSS = 7                                                                     
int paALSA = 8                                                                     
int paAL = 9                                                                     
int paBeOS = 10                                                                    
int paWDMKS = 11                                                                    
int paJACK = 12                                                                    
int paWASAPI = 13                                                                    
int paNoDevice = -1                                                                    
    PaErrorCode Values
int paNoError = 0                                                                     
int paNotInitialized = -10000                                                                
int paUnanticipatedHostError = -9999                                                                 
int paInvalidChannelCount = -9998                                                                 
int paInvalidSampleRate = -9997                                                                 
int paInvalidDevice = -9996                                                                 
int paInvalidFlag = -9995                                                                 
int paSampleFormatNotSupported = -9994                                                                 
int paBadIODeviceCombination = -9993                                                                 
int paInsufficientMemory = -9992                                                                 
int paBufferTooBig = -9991                                                                 
int paBufferTooSmall = -9990                                                                 
int paNullCallback = -9989                                                                 
int paBadStreamPtr = -9988                                                                 
int paTimedOut = -9987                                                                 
int paInternalError = -9986                                                                 
int paDeviceUnavailable = -9985                                                                 
int paIncompatibleHostApiSpecificStreamInfo = -9984                                                                 
int paStreamIsStopped = -9983                                                                 
int paStreamIsNotStopped = -9982                                                                 
int paInputOverflowed = -9981                                                                 
int paOutputUnderflowed = -9980                                                                 
int paHostApiNotFound = -9979                                                                 
int paInvalidHostApi = -9978                                                                 
int paCanNotReadFromACallbackStream = -9977                                                                 
int paCanNotWriteToACallbackStream = -9976                                                                 
int paCanNotReadFromAnOutputOnlyStream = -9975                                                                 
int paCanNotWriteToAnInputOnlyStream = -9974                                                                 
int paIncompatibleStreamHostApi = -9973                                                                 

Function Details

get_sample_size(format)

Returns the size (in bytes) for the specified sample format (a PaSampleFormat constant).

Parameters:
format -

PortAudio sample format constant PaSampleFormat.

Returns:

int

Raises:
ValueError -

Invalid specified format.

get_format_from_width(width, unsigned=True)

Returns a PortAudio format constant for the specified width.

Parameters:
width -

The desired sample width in bytes (1, 2, 3, or 4)

unsigned -

For 1 byte width, specifies signed or unsigned format.

Returns:

PaSampleFormat

Raises:
ValueError -

for invalid width

get_portaudio_version()

Returns portaudio version.

Returns:

str

get_portaudio_version_text()

Returns PortAudio version as a text string.

Returns:

str


Variable Details

PaSampleFormat

A list of all PortAudio PaSampleFormat value constants.

See: paInt32, paInt24, paInt16, paInt8, and paUInt8.

Type:
list
Value:
['paFloat32',
 'paInt32',
 'paInt24',
 'paInt16',
 'paInt8',
 'paUInt8',
 'paCustomFormat']                                                     

PaHostApiTypeId

A list of all PortAudio PaHostApiTypeId constants.

See: paInDevelopment, paDirectSound, paMME, paASIO, paSoundManager, paCoreAudio, paOSS, paALSA, paAL, et al...

Type:
list
Value:
['paInDevelopment',
 'paDirectSound',
 'paMME',
 'paASIO',
 'paSoundManager',
 'paCoreAudio',
 'paOSS',
 'paALSA',
...                                                                    

PaErrorCode

A list of all PortAudio PaErrorCode constants. Typically, error code constants are included in Python exception objects (as the second argument).

See: paNoError, paNotInitialized, paUnanticipatedHostError, et al...

Type:
list
Value:
['paNoError',
 'paNotInitialized',
 'paUnanticipatedHostError',
 'paInvalidChannelCount',
 'paInvalidSampleRate',
 'paInvalidDevice',
 'paInvalidFlag',
 'paSampleFormatNotSupported',
...                                                                    

paFloat32

Type:
int
Value:
1                                                                     

paInt32

Type:
int
Value:
2                                                                     

paInt24

Type:
int
Value:
4                                                                     

paInt16

Type:
int
Value:
8                                                                     

paInt8

Type:
int
Value:
16                                                                    

paUInt8

Type:
int
Value:
32                                                                    

paCustomFormat

Type:
int
Value:
65536                                                                 

paInDevelopment

Type:
int
Value:
0                                                                     

paDirectSound

Type:
int
Value:
1                                                                     

paMME

Type:
int
Value:
2                                                                     

paASIO

Type:
int
Value:
3                                                                     

paSoundManager

Type:
int
Value:
4                                                                     

paCoreAudio

Type:
int
Value:
5                                                                     

paOSS

Type:
int
Value:
7                                                                     

paALSA

Type:
int
Value:
8                                                                     

paAL

Type:
int
Value:
9                                                                     

paBeOS

Type:
int
Value:
10                                                                    

paWDMKS

Type:
int
Value:
11                                                                    

paJACK

Type:
int
Value:
12                                                                    

paWASAPI

Type:
int
Value:
13                                                                    

paNoDevice

Type:
int
Value:
-1                                                                    

paNoError

Type:
int
Value:
0                                                                     

paNotInitialized

Type:
int
Value:
-10000                                                                

paUnanticipatedHostError

Type:
int
Value:
-9999                                                                 

paInvalidChannelCount

Type:
int
Value:
-9998                                                                 

paInvalidSampleRate

Type:
int
Value:
-9997                                                                 

paInvalidDevice

Type:
int
Value:
-9996                                                                 

paInvalidFlag

Type:
int
Value:
-9995                                                                 

paSampleFormatNotSupported

Type:
int
Value:
-9994                                                                 

paBadIODeviceCombination

Type:
int
Value:
-9993                                                                 

paInsufficientMemory

Type:
int
Value:
-9992                                                                 

paBufferTooBig

Type:
int
Value:
-9991                                                                 

paBufferTooSmall

Type:
int
Value:
-9990                                                                 

paNullCallback

Type:
int
Value:
-9989                                                                 

paBadStreamPtr

Type:
int
Value:
-9988                                                                 

paTimedOut

Type:
int
Value:
-9987                                                                 

paInternalError

Type:
int
Value:
-9986                                                                 

paDeviceUnavailable

Type:
int
Value:
-9985                                                                 

paIncompatibleHostApiSpecificStreamInfo

Type:
int
Value:
-9984                                                                 

paStreamIsStopped

Type:
int
Value:
-9983                                                                 

paStreamIsNotStopped

Type:
int
Value:
-9982                                                                 

paInputOverflowed

Type:
int
Value:
-9981                                                                 

paOutputUnderflowed

Type:
int
Value:
-9980                                                                 

paHostApiNotFound

Type:
int
Value:
-9979                                                                 

paInvalidHostApi

Type:
int
Value:
-9978                                                                 

paCanNotReadFromACallbackStream

Type:
int
Value:
-9977                                                                 

paCanNotWriteToACallbackStream

Type:
int
Value:
-9976                                                                 

paCanNotReadFromAnOutputOnlyStream

Type:
int
Value:
-9975                                                                 

paCanNotWriteToAnInputOnlyStream

Type:
int
Value:
-9974                                                                 

paIncompatibleStreamHostApi

Type:
int
Value:
-9973                                                                 

__author__

Type:
str
Value:
'Hubert Pham'                                                          

__version__

Type:
str
Value:
'0.1.0'                                                                

__revision__

Type:
str
Value:
'$Revision: 6 $'                                                       

Generated by Epydoc 2.1 on Thu May 25 13:09:00 2006 http://epydoc.sf.net