rserota / wad

Web Audio DAW. Use the Web Audio API for dynamic sound synthesis. It's like jQuery for your ears.
MIT License
1.9k stars 160 forks source link

3D panning to surround speakers? #55

Closed timotoots closed 5 years ago

timotoots commented 8 years ago

Hey! Do you think it would be possible to use surround sound support for the 3D panning? So you could play some sound effects from the back speakers of 5.1 surround system?

I know the HTML5 plays it well if it's in the source file. Does wad have any support for surround?

Thanks!

rserota commented 8 years ago

If you use 3d panning to set a sound to play from behind the listener ( e.g. setPanning([0, 0, -10]) ), I expect you'd hear it from your rear speakers, though I'm not actually sure how well that would work.

timotoots commented 8 years ago

Thanks, I will try if it works.

timotoots commented 8 years ago

I tried it finally and it seems not to work.

Also I noticed if I loaded a surround sound file (wave with sound in rear left speaker) to wad, it did not play at all. It did play in rear left channel if played directly in Chrome.

It it worked, it would be great to use wad for surround sound installations! Do all sorts of crazy motion sounds would be possible etc.

timotoots commented 8 years ago

Maybe wad would just need to set channel configuration? Like here: https://www.w3.org/TR/webaudio/#ChannelLayouts I would do it, but my code ability is limited..

rserota commented 8 years ago

Setting channel configuration looks useful. I'll look into it as I find time. However, I don't have surround sound speakers, so I'm not sure if I'd be able to test it well.

julianpoy commented 8 years ago

I have a surround system. Perhaps if someone were to make the changes, I could test them?

I would be willing to implement this, but I am short on time for the next week. Maybe I'll get to doing something like this next week.

@torch2424 Would you be interested in coming over and developing this together?

timotoots commented 8 years ago

I could test as well. I have cheap 5.1 sound card with two pairs of headphones for testing.