home
 
 index of namespace default
 
 index of project tkportaudio
 
 index of module tkportaudio

Class tkportaudio.PortAudio


SynopsisPseudo-static utility class which is used to init/tear down the library, query devices, open streams etc.  

  Base classes:
  Methods:
  Constants: Description:


 
For an example on how to use this library, see the "test.tks" script in the tkportaudio/ folder.


 
 top of page
Method GetDefaultInputDeviceIndex
Query default input device index
Signature
GetDefaultInputDeviceIndex():int
Returns
int

 
 top of page
Method GetDefaultOutputDeviceIndex
Query default output device index
Signature
GetDefaultOutputDeviceIndex():int
Returns
int

 
 top of page
Method getDeviceInfo
Query information for the given device
Signature
getDeviceInfo(intdevIdx)
 :PaDeviceInfo
Arguments
intdevIdx0..GetNumDevices()
Returns

 
 top of page
Method GetNumDevices
Query number of available devices
Signature
GetNumDevices():int
Returns
int

 
 top of page
Method GetSampleSize
Query sample size (number of bytes) for the given sample format.
Signature
GetSampleSize(intsampleFormat)
 :int
Arguments
intsampleFormatSee PA_xxx constants, e.g. PA_INT24.
Returns
int

 
 top of page
Method Initialize
Initialize the portaudio library
Signature
Initialize()

 
 top of page
Method IsFormatSupported
Signature
IsFormatSupported(PaStreamParametersinParams,
  PaStreamParametersoutParams,
  floatsampleRate 
  )  
 :boolean
Arguments
PaStreamParametersinParams
PaStreamParametersoutParams
floatsampleRate
Returns
boolean

 
 top of page
Method OpenStream
Open audio stream and initialize the given PaStream object.
Signature
OpenStream(PaStreamParametersinParams,
  PaStreamParametersoutParams,
  floatsampleRate,
  FunctionstreamCbk,
  PaStreamretStream 
  )  
 :int
Arguments
PaStreamParametersinParamsInput stream parameters
PaStreamParametersoutParamsOutput stream parameters
floatsampleRateSample rate (Hz)
FunctionstreamCbkStream callback function. Argument list must be (PaStream stream, FloatArray input, FloatArray output, int numFrames).
PaStreamretStreamThe stream object to initialize
Returns
int1(true) if the stream has been opened, 0(false) otherwise.
Description

Note: The stream callback always uses float arrays. Conversions to/from the actual sample formats are transparent to the application.

 
 top of page
Method Terminate
Tear down the portaudio library.
Signature
Terminate()
Description

All streams/info objects become invalid after this call (resp. their internal data does).

 
 top of page
Constant PA_FLOAT (int)
single precision floating point sample format (4 bytes)
Constant PA_INT16 (int)
16bit signed integer sample format (2 bytes)
Constant PA_INT24 (int)
24bit signed integer sample format (3 bytes)
Constant PA_INT32 (int)
32bit signed integer sample format (4 bytes)
Constant PA_INT8 (int)
8bit signed integer sample format (1 byte)
Constant PA_UINT8 (int)
8bit unsigned integer sample format (1 byte)

 

Project Modules:tkportaudio 
Project Classes:PaDeviceInfo , PaHostApiInfo , PaStream , PaStreamParameters , PortAudio 
Project Functions:
All Namespaces:default , ui 
All Projects:core , debugtext , tkfreetype2 , tkmath , tkmidi , tkopengl , tkportaudio , tksdl , tkui , tkunit 


auto-generated by "DOG", the TkScript document generator. Mon, 28/Dec/2015 13:15:54