My app works with either 16, 24 or 32 bits. It generates several audio signals and you can either play them or save them as *.wav. It works properly with 16 bits but if I choose 24 or 32 bits it writes the wavs well but when playing writing to SourceDataLine it does weird things:
- It gives less level to the right channel at 0dbFs Stereo sine
- Writing zeros to one of the two channels don't mute that channel.
I have two sound cards and i have tried with different Mixers and different sound cards but didn't solve anything. And searching the web i found this:
Whilst the JavaSound API provides for greater than 16 bits (and sample rates above 48k for that matter) I've not had any luck with finding a Java Runtime that supports anything besides 16 bit and 44.1k or 48k (under OS X you even struggle to get anything besides 44.1k). If you are on Windows it would be worth looking at Martin Roth's JAsioHost (https://github.com/mhroth/jasiohost) which allows you to access soundcards via their ASIO drivers and write to them using float sample data.