Unable to load/decode 8 bit unsigned WAV file
macOS 10.14.1, Processing 3.4, Sound 2.0.2
Nov 12, 2018 12:30:43 AM com.jsyn.engine.SynthesisEngine start INFO: Pure Java JSyn from www.softsynth.com, rate = 44100, RT, V16.8.0 (build 463, 2017-10-16) Sound library error: unable to decode sound file
This is a small .wav file that plays without problems in Preview. (attached)
Edit: Minim opens and plays the file.
Thanks for providing the sound file, it's very helpful! I think JSyn fails to decode the file because it is in unsigned (8 bit) PCM encoding. To fix this we will probably have to switch to a different library/code for loading WAV samples.
Good to hear. The file is created with http://github.grumdrig.com/jsfxr/, one of the bfxr/sfxr family of tools to generate sound effects for games.
Just to confirm, the lack of support for compressed WAV formats is documented here: http://www.softsynth.com/jsyn/docs/javadocs/com/jsyn/util/SampleLoader.html
Despite what it says there, setting the Javasound preferred flag does not add support for 8bit unsigned WAV files. I wonder if we could somehow still easily add support by fiddling with JavaSounds's AudioInputStream class directly.