Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load/decode 8 bit unsigned WAV file #15

Closed
crcdng opened this issue Nov 12, 2018 · 3 comments
Closed

Unable to load/decode 8 bit unsigned WAV file #15

crcdng opened this issue Nov 12, 2018 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@crcdng
Copy link

crcdng commented Nov 12, 2018

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.

ping.wav.zip

@kevinstadler kevinstadler added bug Something isn't working help wanted Extra attention is needed labels Nov 14, 2018
@kevinstadler
Copy link
Collaborator

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.

@kevinstadler kevinstadler changed the title Sound library error: unable to decode sound file Unable to load/decode 8 bit unsigned WAV file Nov 14, 2018
@crcdng
Copy link
Author

crcdng commented Nov 14, 2018

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.

@kevinstadler
Copy link
Collaborator

kevinstadler commented May 15, 2019

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.

kevinstadler added a commit that referenced this issue Sep 13, 2023
This will break Android support to some extent, but fixes #32 by
switching to the much more well-supported (and 4x faster!) mp3spi,
closes #53 by adding support via vorbisspi, and also fixes #15 since 8
bit wav files are are now simply decoded through JavaSound.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants