posted 13 years ago
Hi guys,
I have some code which converts 16bit audio from byte data to short arrays (or any type of arrays) for processing. Once all sorts of possible processing is done, it is then converted back to a byte array for playback. I've attached the code which does this initial conversion at the bottom of this email.
I've recently starting using the jlayer, mp3spi, and tritonus_share libraries. So far i'm able to get metadata from the mp3 files easily, however i'm struggling to get the audio converted into a format that's playable by my software. When i use: int bytesread = din.read(bytes, 0, (int) bufSize);
'bytesread' is only 4068 regardless of the mp3 file, or the values of bufSize/the size of the bytes[] array. When using 16bit wavs, bytesread is the same size as bufSize and bytes[]. All the audio which comes out after conversion from a byte array (from the code below) is silent/has a value of 0.
Can anyone let me know why i can't 'access' this raw byte data for conversion?
'din' is the decoded audioInputStream, you can see the 'standard' audio code here:
When i try to use 'int bytesread = audioInputStream.read(bytes, 0, (int) bufSize); - all i get is white noise!
Many thanks,
Eddie
============