Thanks, done.

Tilman

Am 09.07.2016 um 15:22 schrieb Gilad Denneboom:
I had to play a bit with the settings to get working correctly with my
8-bit clips.
This is the code I ended up using:

     private static InputStream getAudioStream(String filename) throws
Exception {
         File file = new File(filename);
         AudioInputStream in = AudioSystem.getAudioInputStream(file);
         AudioFormat baseFormat = in.getFormat();
         AudioFormat decodedFormat = new AudioFormat(
             AudioFormat.Encoding.PCM_UNSIGNED,
             baseFormat.getSampleRate(),
             baseFormat.getSampleSizeInBits(),
             baseFormat.getChannels(),
             baseFormat.getChannels(),
             baseFormat.getSampleRate(),
             false);
         return AudioSystem.getAudioInputStream(decodedFormat, in);
     }

Feel free to post it as a follow-up to your SO reply (I don't have enough
"reputation" there to do so myself, I'm afraid).



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to