Mark Lord said that if someone could implement an API that would return PCM data from an Ogg Vorbis stream that he might be able to hack it into Hijack so that the player app would think it was playing a WAV file.
Cool, when I get my IDE cable I'll communicate with him.
I was thinking about hacking up an LD_PRELOAD to capitalize on wav support.
To get the PCM data out of an ogg, you just build Tremor and then do something like (error checking omitted for clarity):
#include <ivorbisfile.h>
#define PCM_SIZE (4096) /*however big you want PCM bufs */
...
OggVorbis_File vf;
int current_section=0;
char *pcm_buf=malloc(PCM_SIZE);
FILE *input=fopen("whatever.ogg", "r");
ov_open(input, &vf, NULL, 0);
while(ov_read(&vf, pcm_buf, PCM_SIZE, ¤t_section)>0) {
/* pcm_buf contains PCM data--do whatever you want */
}
/* pcm_buf contains the last frame, handle it */
ov_clear(&vf); /* close() equivalent.
ov_read returns up to the specified number of bytes of decoded audio in host-endian, signed 16 bit PCM format. If the audio is multichannel, the channels are interleaved in the output buffer.
In RL you need to keep the ov_read return value to see how many bytes were actually returned (and check allfopen()/ov_open()/malloc()/ov_clear() rvs).
Sumner