Closed Jared-Sprague closed 8 years ago
I've been looking at web audio libraries, trying to find a good one.
To keep it simple for now I'm just going to use howler.js to play audio files from freesound.org :D
Sounds good!
Done! I added a set of 7 soft chime sounds. A random one is played each time you capture a food. I think it's a good start! It gets a little bit noisy when you're large and capturing a lot of food, but NOT nearly as bad as I expected!
The Howlerjs library has a really cool feature that allows you to set the 3d position of the sound, and it decreases the volume based on that distance. I created Beta issue #146 to handle that.
Hmm, right now I'm not hearing any sound effects on my Android phone. I tried Firefox and Chrome. My best guess is that wav files can't be played on Android. I can convert the files to other formats and test.
No sound on Cas's iPad either. Must investigate.
My mistake! I think it's because I didn't copy client/sfx
into the build via build.sh. Sound doesn't work in production at all, likely because of that.
For alpha I'm thinking just adding one sound effect would be good. would make it really easy to add more before beta