Sound2D Class (Demo and Source)


(Mike Evmm) #1

I quickly prototyped this 2D sound class today. I think it might have some interesting potential:
https://dl.dropboxusercontent.com/u/24607148/3DSound.swf
The circle is the source of the sound. Best seen with headphones.


Edit: Sorry, I had set something wrong, the effect was off. Should be fixed now.


(Jacob Albano) #2

I actually think it was better before. Right now it seems like the pan is backwards, and the falloff is quite sharp.


(Mike Evmm) #3

@jacobalbano I’ve added an ear and a speaker icon which I hope will justify why the pan is backwards. (What I was aiming for was that, if you closed your eyes, you could tell the sound was, for example, to your left, meaning the mouse is to its right). Regarding the rolloff, I used a logarithmic function (I read somewhere that real-life loudness behaved logarithmically), but I suppose it could be easily replaced by a linear function.
Thanks for trying it out!


P.S. (I forgot, sorry) The sound also has a loudness property (which right now is kind of low by default). I’ve added a HUD, and it’s adjustable with the Up/Down keys.


(Jacob Albano) #4

Ah, got it! The icons do help to make things clearer. I like it a lot!


(Mike Evmm) #5

I’ll just leave this here.