processing / processing-sound

Audio library for Processing built with JSyn
https://processing.org/reference/libraries/sound/
GNU Lesser General Public License v2.1
149 stars 50 forks source link

Processing sound issue windows 10 and android #45

Closed markcosmic closed 1 year ago

markcosmic commented 5 years ago

Microsoft may not be your friend. As of the latest windows 10 update; in Java mode a simple soundFile method no longer plays sound. Yet, the same sketch works perfect in the soon to be unsupported windows 7. In windows 10 the sketch doesn’t crash but produces an error that mentions windows 10 not being compatible with certain 8 bit .WAV audio files. In Android mode in the emulator and on a moto4; the first time I run the app, Processing Sound plays all the little sound files as it should. I quit the app using an exit() method after looking at all the audio files used and closing them if they’re open. The same app now in the background restarted produces no sound. I quit the app as described, and close it in the background, then restart it and the sound now works. There is still as reported by other a certain sound distortion that can happen when small file sounds (sound effects) are repeatedly played back. Using this sample code: if(blip.isPlaying){ blip.stop(); }else{ blip.play(); } On a side note... coding in processing is super fun and rewarding. Thank you all for making accessible to everyone

markcosmic commented 5 years ago

I’ve been testing the windows 10 “no sound “ issue with different sound file formats (.WAV, .MP3, .AIF). All produced errors and no sound. Interestingly, the .AIF format produced the least errors. In testing in Android mode and windows 7 java mode, I found the .AIF format produced no distortion on small file sound effects that are replayed repeatedly within a short (<1/2 second) timeframe; unlike the .WAV format, which seemed to produce much distortion under the same circumstance. I had difficulty with the .MP3 format. I not sure of the compression scheme that Processing.Sound can work with. That’s it for now. Thanks all!