Hi
Does anyone have any experience in decoding MP3 files and using them in OpenAL?
I'm using JLayer to try this but with no JLayer documentation its quite tricky.
This is the simple code I have so far
File file = new File(args[0]);
Bitstream bitstream = new Bitstream(file.toURI().toURL().openStream());
AudioDevice audioDevice = FactoryRegistry.systemRegistry().createAudioDevice();
Decoder decoder = new Decoder();
audioDevice.open(decoder);
boolean process = true;
WaveFileObuffer wfo = new WaveFileObuffer (1,192,"/Users/me/test.wav");
decoder.setOutputBuffer(wfo);
while (process)
{
Header header = bitstream.readFrame();
if (header == null)
{
process = false;
break;
}
decoder.decodeFrame(header, bitstream);
}
Its not quite working at the moment, the output should be a file created in .wav format (I guess I can write my own ostream which can save an inputstream rather than a file). I realise this isn't a JLayer forum but wantred to see if there were any people using OpenAL out there who have used JLayer successfully