python - Difference between paInt32, paInt16, paInt24, paFloat32, etc.? -


i using python 2.7.12 on ubuntu 16.04 lts while trying (learning) pyaudio module. have mention type of format should require recording audio microphone. know difference between

papaint32,paint16,paint24,pafloat32,paint8,pauint8 

and when use each format. trying (learning) pyaudio python pyaudio.pyaudio examples.

portaudio supports audio input , output in variety of sample formats: 8, 16, 24 , 32 bit integer formats , 32 bit floating point, irrespective of formats supported native audio api.

a type used specify 1 or more sample formats. each value indicates possible format sound data passed , stream callback, pa_readstream , pa_writestream.

reference

the standard formats pafloat32, paint16, paint32, paint24, paint8 , auint8 implemented implementations.

the floating point representation (pafloat32) uses +1.0 , -1.0 maximum , minimum respectively.

pauint8 unsigned 8 bit format 128 considered "ground"

the panoninterleaved flag indicates audio data passed array of pointers separate buffers, 1 buffer each channel. usually, when flag not used, audio data passed single buffer channels interleaved.

reference

if using float32, code should fine. if using paint32 (or 24/16/8), need make sure cast int (or short, char, etc) after multiplication


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -