I am currently working on mp3 decoding with javalayer 1.1.
So I want to receive the raw PCM data from my 44100 Hz, 16bit, Mp3s. It is perfectly working fine with ste
I got it working, converting to byte[], using this code:
ByteArrayOutputStream outStream = new ByteArrayOutputStream(1024); int divider = 1; if (SAMPLE_RATE < 44100) divider *= 2; if (CHANNELS == 1) divider *= 2; [...] short[] pcmBuffer = buffer.getBuffer(); for (int i=0; i
> 8 ) & 0xff); }
The key was the divider
parameter, that is 1
in stereo-44, 2
in mono-44 and 4
in mono-22. Didn't try yet other combinations.