ScriptaGames / zorbio

A 3D multiplayer WebGL game
MIT License
8 stars 1 forks source link

add some basic sound FX #24

Closed Jared-Sprague closed 8 years ago

mwcz commented 8 years ago

For alpha I'm thinking just adding one sound effect would be good. would make it really easy to add more before beta

mwcz commented 8 years ago

I've been looking at web audio libraries, trying to find a good one.

mwcz commented 8 years ago

To keep it simple for now I'm just going to use howler.js to play audio files from freesound.org :D

Jared-Sprague commented 8 years ago

Sounds good!

mwcz commented 8 years ago

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.

mwcz commented 8 years ago

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.

mwcz commented 8 years ago

No sound on Cas's iPad either. Must investigate.

mwcz commented 8 years ago

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.