I'm trying to figure out how to use libmad with C. The trouble is, libmad converts audio files to .pcm files and I'm unable to find a way to play these files. There is no straightforward .pcm player, and Audacity crashes every time I try to open the pcm file with it. Does any one have any experience with this? I'm open to converting these pcm files to wav files or some other format, but again there's no straightforward way to do this (at least I haven't found one).
Are you sure you're getting valid PCM data? What type of PCM are you getting?
Basic PCM is used on audio CDs and in WAV files ripped from CDs; it should be playable by just about anything. Specifically, it is 16-bit (per sample), 44.1 kHz (sample rate), stereo (2 channels). Playing this kind of PCM is as simple as
The libmad homepage indicates that libmad may default to outputting 24-bit PCM, and your player software could be confused by it if expecting the standard 16-bit PCM. If you haven't already, check your program's libmad usage against the
Since PCM data doesn't include headers like a WAV file does, you may need to specify the PCM format for a program to load the file correctly. Audacity should be able to handle any standard PCM format.
It's also possible you're getting invalid PCM output from
Perhaps you can use a tool like Sox