Monday, March 26, 2012

PyAudio with 24 bit under windows

Here are the results, proofing that with the WASAPI architecture I got true audio 24 bit samples under Windows 7:

Sunday, March 25, 2012

PyAudio: How to get 24 bit support under windows


PyAudio is a really useful and user-friendly python extension for accessing the soundcard from python.

Pyaudio uses the portaudio bindings between some windows sound architecture and python. Only the WASAPI and the ASIO APIs on windows 7 support real 24 bit resolution. The standard version that comes shipped with pyaudio is compiled for WMME which is old and emulates win xp sound. It converts the 24 bit data to 16 bit and calculates with this precission internally. It returns 24 bit numbers but this is zero-padded16 bit data (can be seen as there is no change in the quantizing noise floor)

So pyaudio and portaudio needs to be rebuilt from source to support WASAPI. (or ASIO but you have to register at steinberg as a developer to get the SDK from there)

This is how I managed to build it: