GLBasic forum

Main forum => GLBasic - en => Topic started by: djtoon on 2011-Jan-19

Title: 3d sound on the iphone
Post by: djtoon on 2011-Jan-19
i read somewhee that iphone uses openal and supports 3d sound.

is there a way to use it? or comple openal as a library for glbasic?
10x
dan
Title: Re: 3d sound on the iphone
Post by: Kitty Hello on 2011-Jan-20
3D sound. On an iPhone.
Uhm... Isn't that a bit of what the device is not used for?
I mean - does it even have 4 sound output jacks?
Title: Re: 3d sound on the iphone
Post by: erico on 2011-Jan-20
Quote from: djtoon on 2011-Jan-19
i read somewhee that iphone uses openal and supports 3d sound.

is there a way to use it? or comple openal as a library for glbasic?
10x
dan

You could prepare the sound before to sound 3d, but probably have a few versions of the same sound to simulate major positions from camera. it can work if whatever you are doing has not many sounds and you don't wanna change it while playing.

I also guess you would have to be using ear phones to catch any effects on this or enything spacial coming from a small device.
Title: Re: 3d sound on the iphone
Post by: Slydog on 2011-Jan-20
Or do you mean playing sounds in a 3D world?
And each sound is placed at an x,y,z location so the closer the camera gets to that location, the louder it becomes.  (with a cut off point)
And sound sources on both sides of you play through the respective iPhone speaker?
Title: Re: 3d sound on the iphone
Post by: djtoon on 2011-Jan-20
yap
like papa sangre :) chk the app out
its amaizing the audio there
Title: Re: 3d sound on the iphone
Post by: Hemlos on 2011-Jan-28
What you do is use the "balance" feature in the sound command.
You must know where the source is, in relation to the center of your camera point to position.
Anything from dead ahead, to 90 degrees to your left or right, should be full volume in one channel or another(r/l).
Lower the volume, obviously,  it as moves away.
Compensate for things "behind" you with a lower volume([0..25%]less volume?) which will mimic the shape of the human ear.


I had planned on making a 3d sound lib for 2 channel stereo output.
But im not starting it until i am done with the spritez code generator.(months, years? lol)
It likely will only be a single function instead of a lib, and probably really easy to write.