Browse Source Download (without any required ccan dependencies)
ogg_to_pcm
decode ogg vorbis audio files to PCM data using libvorbis
ogg_to_pcm implements a single function using libvorbis to decode signed 16 bit ogg audio data to signed 16 bit PCM data.
#include <stdint.h>
#include <ccan/ogg_to_pcm/ogg_to_pcm.h>
int main(int argc, char *argv[])
{
int16_t *pcmbuffer;
int rc, sample_size, sample_rate, channels, nsamples;
rc = ogg_to_pcm("mysound.ogg", &pcmbuffer,
&sample_size, &sample_rate, &channels, &nsamples);
if (rc != 0)
return -1;
return 0;
}
GPLv2