Position a sound in 3D Space?
Position a sound in 3D Space?
So far, I have yet to come across anything that meshes sound with OGRE. I have seen several demos but none with sound.
I cut my teeth on DARKBasic PRO which has a POSITION SOUND command (not to mention a POSITION LISTENER command) which allows extreme flexible and realistic sound positioning in 3D space.
I have searched these forums, PureArea.net, and the OGRE site, but can't seem to find anything like this.
Does anyone know of, or has crafted, such a command for PureBasic's OGRE Interface?
Thanks in advance.
I cut my teeth on DARKBasic PRO which has a POSITION SOUND command (not to mention a POSITION LISTENER command) which allows extreme flexible and realistic sound positioning in 3D space.
I have searched these forums, PureArea.net, and the OGRE site, but can't seem to find anything like this.
Does anyone know of, or has crafted, such a command for PureBasic's OGRE Interface?
Thanks in advance.
-
Brice Manuel
-
Brice Manuel
Possibly you are since the current implementation of Ogre is not really capable of making a complete game.But I am sure I can't be the first person to hit this hurdle,
Your best bet would be OpenAL, you can find a wrapper lib here:
http://purearea.net/pb/download/userlibs/OpenAL.zip
I have no idea how good this lib is, but I have used OpenAL itself in commercial projects with no issues. http://www.openal.org/ Most PB libs are pretty good so you should be "ok".
Thanks. checking that out now.
OGRE does appear to be used to create full games: http://www.ankh-game.de/
What about FMOD? Anyone have luck with that?
BTW - I am looking for a "pure" solution, i.e. cross-platform, preferable something not dependent on DX (like OpenAL)
OGRE does appear to be used to create full games: http://www.ankh-game.de/
What about FMOD? Anyone have luck with that?
BTW - I am looking for a "pure" solution, i.e. cross-platform, preferable something not dependent on DX (like OpenAL)
-
Brice Manuel
That wasn't written in PB. I said "current implementation", as in what PB uses. The version PB uses is rather old and does not support all of the features of the current Ogre engine. Hopefully once 4.0 hits, Fred can dedicate some time to catching PB's 3D up. Ogre has progressed quite a bit from what we are stuck with in PBOGRE does appear to be used to create full games
FMOD is nice, but can be costly depending on what you are using it for. AFAIK there are not any full wrappers for PB, only partial wrappers.What about FMOD? Anyone have luck with that?
OpenAL works on Windows, Linux, Mac OS 8/9, Mac OS X, BSD, Solaris, IRIX, XBOX, XBOX 360. With the exception of Amiga (which is dead) OpenAL supports every platform PB does and then some. What other platforms are you wanting? PB only supports Windows, Mac & Linux.BTW - I am looking for a "pure" solution, i.e. cross-platform, preferable something not dependent on DX (like OpenAL)
You could always program your own 3D sound system:
Calculate the Y angle between the sound and listener positions (which you have to store yourself)
Add this angle and the listener's angle
Pan the sound by the sine of the final angle
(If your game has free all-axis rotation, you have to work Z-rotation into this)
And for the sound volume,
Find the distance between the sound and listener
If the distance is greater than the sound's audible radius, mute it
If not, divide the distance by the radius and "invert" it (it = 1 - it)
Then set the sound's volume according to that 0>1 value.
My apologies if you already know all this and definitely want a sound library.
Calculate the Y angle between the sound and listener positions (which you have to store yourself)
Add this angle and the listener's angle
Pan the sound by the sine of the final angle
(If your game has free all-axis rotation, you have to work Z-rotation into this)
And for the sound volume,
Find the distance between the sound and listener
If the distance is greater than the sound's audible radius, mute it
If not, divide the distance by the radius and "invert" it (it = 1 - it)
Then set the sound's volume according to that 0>1 value.
My apologies if you already know all this and definitely want a sound library.
-
Froggerprogger
- Enthusiast

- Posts: 423
- Joined: Fri Apr 25, 2003 5:22 pm
- Contact:
FMOD is a really cool and cross-platform (but possibly expensive, if your program isn't freeware).
With new fmod 4 you can even feed the audioengine with your polygon-world and position your sounds inside it. As many as you want. Further place a listener (the player) that is moving around in this world. fmod calculates and plays all (or an optimal maximal selection of) the sounds, that the listener hears inkl. obstruction/occlusion/doppler, etc.
I don't know, if there's any other audioengine giving you this comfort.
With new fmod 4 you can even feed the audioengine with your polygon-world and position your sounds inside it. As many as you want. Further place a listener (the player) that is moving around in this world. fmod calculates and plays all (or an optimal maximal selection of) the sounds, that the listener hears inkl. obstruction/occlusion/doppler, etc.
I don't know, if there's any other audioengine giving you this comfort.
Yes, the wrapper that let you call fmod-commands directly is not out now (due to a bug in pb). But you can access all the functionality using the OpenLibrary() and CallFunction()-commands.AFAIK there are not any full wrappers for PB, only partial wrappers.
%1>>1+1*1/1-1!1|1&1<<$1=1
Don't forget about BASS libary, it has more features than FMOD like recording as well as playback, DX8+ support, EAX, 3D and more.
I haven't compared prices, but BASS may be a bit cheaper.
http://www.un4seen.com/
Altough, PureBasic 4.x with OpenAL support would be great
I haven't compared prices, but BASS may be a bit cheaper.
http://www.un4seen.com/
Altough, PureBasic 4.x with OpenAL support would be great
-
Froggerprogger
- Enthusiast

- Posts: 423
- Joined: Fri Apr 25, 2003 5:22 pm
- Contact:
@Rescator
I don't want to start a flame, but already fmod 3 can do the things you mentioned.
fmod 4 can even do much, much more. Just take a look at www.fmod.org 'features' and especially their 'news' since fmod 4 at the startpage. I think fmod 4 is without concurrency at the moment.
I don't want to start a flame, but already fmod 3 can do the things you mentioned.
fmod 4 can even do much, much more. Just take a look at www.fmod.org 'features' and especially their 'news' since fmod 4 at the startpage. I think fmod 4 is without concurrency at the moment.
%1>>1+1*1/1-1!1|1&1<<$1=1
Yeah that's a shame, as I find BASS very easy. I did try FMOD some time back, but went with BASS as at the time FMOD did not support recording.
I see FMOD Ex finaly does though.
As to licenses, BASS is cheaper.
FMOD cost a bit more for commercial use,
and the license requirements are somewhat stricter than BASS.
The huge bonus point is that FMOD Ex seem very mature now.
And with it being on so many platforms and planned for PS3,
it's definetly worth a look for those that make commercial software or games
for multiple platforms. (i.e 1 sound API to focus on regardless of system)
BASS is similar to FMOD, while FMOD Ex seems to be the big boy in the street right now.
I'm curious about OpenAL though, anyone checked that out yet?
I'm especially curious about it's recording capabilities if any.
I see FMOD Ex finaly does though.
As to licenses, BASS is cheaper.
FMOD cost a bit more for commercial use,
and the license requirements are somewhat stricter than BASS.
The huge bonus point is that FMOD Ex seem very mature now.
And with it being on so many platforms and planned for PS3,
it's definetly worth a look for those that make commercial software or games
for multiple platforms. (i.e 1 sound API to focus on regardless of system)
BASS is similar to FMOD, while FMOD Ex seems to be the big boy in the street right now.
I'm curious about OpenAL though, anyone checked that out yet?
I'm especially curious about it's recording capabilities if any.
OpenAL has full 3D positioning and altough not directly tied to OpenGLI cut my teeth on DARKBasic PRO which has a POSITION SOUND command (not to mention a POSITION LISTENER command) which allows extreme flexible and realistic sound positioning in 3D space.
it is made in a very similar way (only for audio obviously).
OpenAL will automaticaly either use a soundcards native drivers directly,
or via a wrapper use the OS default hardware or software drivers,
so Win32 should be very well covered via OpenAL. /me petitions Fred to add OpenAL support in PB
And behold, OpenAL has recording as well it seems. Yay me, now to get this thing working!
If I'm able to use this not just for playback but recording as well,
I may actualy ditch BASS for some of my projects.
OpenAL.dll itself is only around 80KB.
The full redistributiuon install exe is just 350 KB or so and includes the hardware and software wrapper/fallback dll as well.
Obviously OpenAL is just a audio/sound API, and has no direct support for ogg or mp3 and so on.
But the cool thing is that it's open source, free, no royalties or licensing costs etc.
It supports (and let you choose as well it seems);
native OpenAL soundcard drivers (Creative and NVIDIA and others install these along with their cards)
DirectX hardware drivers (not quite as optimized as the soundcards native OpenAL drivers obviously)
DirectX software drivers (no hardware features available just software)
/rant
-
DarkDragon
- Addict

- Posts: 2348
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact: