Pan Audio Demo on Share and Fork
Shri

Gio,

 

I came across a couple of tutorials on panning audio using html5 web audio

 

http://webdesign.tutsplus.com/tutorials/web-audio-and-3d-soundscapes-introduction--cms-22650

http://gamedevelopment.tutsplus.com/tutorials/web-audio-and-3d-soundscapes-implementation--cms-22651

 

Anyway, I wanted to see if I could do it with Wade.

 

I put a demo up on share and fork - "Pan Audio Demo".

 

You click the mouse to make the laser sound, it should "pan" from the point of view of the tank.

i.e. click on the left side of the tank, the sound comes form the left, etc.

Use the 'a' and 'd' keys to rotate the tank and the sound tracks with the tanks front facing.

I tested it and it seems to work.

 

If you look at the code, I stripped down and overwrote the wade.playAudio() function with my own panAudio(). I use a global panner and listener which you obviously wouldn't want to use with the engine. It seems like you could come up with an interface and add this cool functionality to the engine in the next release without too much effort.

 

cheers,

Shri

All 3 Comments
tumble

Hello

 

Sorry, I want to try it but I cant find it... where is share and fork - "Pan Audio Demo". I googled it but didnt find anything

Gio

Hi tumble.

 

Shri is talking about this project. Share and Fork used to be a section of our website. We have recently renamed it to simply Projects.

 

Shri, it's very cool. There is a lot you can do with WebAudio and we are planning to expose some cool features of it to the WADE API (currently you can only get the web audio context and do everything yourself at a low level). We are just waiting for Internet Explorer to catch up and start supporting WebAudio, otherwise people may start relying on these features for their games only to find that they don't work for 10% of their users.

 

This is also why WebGL was only introduced quite late and is still not the default mode for WADE layers (this may be changing soon though).

 

In general we tend to wait for Web API's to be well adopted by all major browsers before using them heavily in the engine.

 

Still, your shared project is going to be very useful to people who want to have this feature sooner rather than later.

tumble

Cool, I didnt know about this. I like the idea of panning audio, can be used for a more immersive experience.

 

Thanks

Post a reply
Add Attachment
Submit Reply
Login to Reply