When I play 24-bit wav files in java they don't play. 16-bit files work fine.
I am using:
InputStream audioInputStream = new FileInputStream(soundFile);
AudioStream audioStream = new AudioStream(audioInputStream);
AudioPlayer.player.start(audioStream);
I realise this method is depreciated, but I am using it for other reasons (reading changeable files from a jar for instance).
Is there any way of playing 24-bit files on java (perhaps internally converting them?). I am using linux, but this needs to work cross-platform.
It doesn't seem possible in java on my linux.
So I bulk converted the files with this script:
for f in $(find ./ -name '*.wav'); do
ffmpeg -i $f -acodec pcm_s16le -ar 44100 ${f%.wav}z.wav;
rm $f;
mv ${f%.wav}z.wav $f;
done
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.