PDA

View Full Version : 3D sound


ylaporte
2002.06.18, 05:10 PM
What is the best option to have 3D sound effects under Mac OSX. Do Sound Sprockets still exist? Are there 3rd party sound libraries helping? Or do I have to do everything myself (please tell me I don't have to)?

OneSadCookie
2002.06.18, 05:42 PM
http://www.crissman.net/macgamewiki/index.php/SoundSprocket
http://www.crissman.net/macgamewiki/index.php/OpenAL

Nimrod
2002.06.18, 05:52 PM
What's the point of 3D sound, when the only card that supports it on the mac is the SoundBlaster Live, which doesn't have OS X drivers and allegedly poor OS 9 support?

Am I missing something?

Iceman
2002.06.18, 06:23 PM
Is there an OpenAL.framework? It all looks like it's for OS 9.

Iceman

willThimbleby
2002.06.18, 07:01 PM
Yes the file at:

ftp://opensource.creative.com/pub/sdk/OpenAL%20Installer.bin

Will install a package that will install a framework for use on MacOS X.

It works fine and I've had several programs running using it. Unfortunately thought the mac version is slightly incomplete, I really wanted to use it for its reverb capabilities.

BTW has anyone a working example, with source, of the supposed in-built reverb capability of MacOS X.

Will

ylaporte
2002.06.18, 07:31 PM
Originally posted by Nimrod
What's the point of 3D sound, when the only card that supports it on the mac is the SoundBlaster Live, which doesn't have OS X drivers and allegedly poor OS 9 support?

Am I missing something?

When I say 3D sound, I mean sound spatialization. In other words, the capacity to make a sound "sound like" it is coming from somewhere in 3D in a particular environment. It can also include other things like the dopler effect, reverbs etc. As you can imagine, it is quite usefull when designing emersive 3D games. Even 2D games can benefit from it.

It doesn't have to be in hardware, in fact, some very advanced experimental sound spatializers are software only (and sometimes not even real-time).

ylaporte
2002.06.18, 07:34 PM
As usual thanks everyone...

I am going to look into OpenAL and the Sound Sprocket implementation pointed by OneSadCookie.

Since I don't have a sound blaster I don't see myself experimenting with it much yet.

Mazilurik
2002.06.18, 07:39 PM
On OS X, CoreAudio has native support for 6-channel surround sound, but at the moment there doesn't seem to be any good sample code on how to use it. I did a quick search of the coreaudio-api mailing list archives and discovered that there was a demonstration of CoreAudio surround sound at WWDC, so hopefully some code from that presentation will be made available.

Carlos Camacho
2002.06.18, 07:49 PM
Logic of Germany, of eLogic Sequencer fame makes a USB device that supports surround sound. Also, Edirol, aka Roland also does.

Cheers

ylaporte
2002.06.18, 09:43 PM
I installed OpenAL and it's SDK since the idea of OpenAL (an portable Sound Spatialization API) is attractive to me. Then I downloaded the reference implementation and ran the test applications that come with it.

Most of the tests fail on my computer. Does the mentionned OpenAL implementation requires you to have some specific hardware?

I am looking more for a software solution since it could be used on any machine.

As of Core Audio, I toyed with it a few months ago and it doesn't seem to offer all the features desirable for game developement. It supports a large number of channels per device but the device itself has to make those channels available. As far as I understand, you still have to feed these channels yourself. And compute special effects yourself as well.

hyperzoanoid
2002.06.18, 09:59 PM
Originally posted by Mazilurik
On OS X, CoreAudio has native support for 6-channel surround sound, but at the moment there doesn't seem to be any good sample code on how to use it. I did a quick search of the coreaudio-api mailing list archives and discovered that there was a demonstration of CoreAudio surround sound at WWDC, so hopefully some code from that presentation will be made available.

yeah ive been looking for a core audio example and i have found a few, but i dont know where to start, like what is an oscillator and reverb. id like to go core audio too.

wadesworld
2002.06.19, 11:49 PM
Folks, OpenAL does NOT require special hardware.

I use both the Classic library and the OS X framework and get excellent results.

Wade

Feanor
2002.06.20, 10:21 AM
Wade, are the libraries currently only available as source code from the CVS, or does somebody have binaries posted? OpenAL might be a good choice for HailStone (my 3D game), since I'd like it to be portable to Linux. -- FÎanor

Iceman
2002.06.20, 08:56 PM
The framework and library are in the same installer here's the link that was posted above: ftp://opensource.creative.com/pub/sdk/OpenAL%20Installer.bin . Also are there any source code examples for OpenAL?

Thanks,
Iceman

OneSadCookie
2002.06.20, 10:09 PM
There's some examples on OpenAL.org which worked OK on MacOSX last time I checked.

ylaporte
2002.06.20, 11:10 PM
Originally posted by Iceman
[B] Also are there any source code examples for OpenAL?


I found a little example code with the source code for OpenAL itself on the CVS. I haven't looked in it much, as I said, the test application that is included records a large number of failures on my OSX machine.

Actually, here's what I get:
Request Object Names Test. PASSED.
Releasing Object Names Test. PASSED.
Validating Object Names Test. PASSED.
State Transition Test. FAILED.
Vector State Transition Test. FAILED -- AL_PLAYING 0FAILED -- AL_PLAYING 1FAILED -- AL_PLAYING 0AFAILED -- AL_PLAYING 1AFAILED.
Get Buffer Properties Test. FAILED.
Enumeration Value Test. PASSED.
Queuing Underrun States Test. FAILED.

Anyone has a clue about what is going on?
When I run the manual tests I never hear any sound out of the speakers.

It sure is not a lot, I'd be interested if anyone knows where we can find more sample code.

wadesworld
2002.06.30, 06:30 PM
I wouldn't worry about the tests.

Just look at the sample code provided in the SDK. It's really not that complex.

Start simple. Add a single source to your game. Get that acting the way you want it, then start adding more sources.

aarku
2002.07.01, 11:21 PM
Just thought I'd mention SoundTerrain. I have been using it for projects and I really like it. Wish he'd update the version though. (The new features he was planning sound nice... like making it compatible with OpenAL)

From the link page on idevgames....

SoundTerrain provides a easy, free and flexible way to play sound effects in your game. It gives you independent control over sound effect volume and pitch. It does 3D sounds and if you like, it will also do Doppler effects. The sound processing is completely asynchronous. It is Carbon compatible and AltiVec accelerated on G4. SoundTerrain does not require any extra extensions to work, nor does it require any knowledge of the Sound Manager. It manages the OS and Sound Channels for you, providing a simple, easy to use interface for managing your sound effects.

http://alienorb.com/SoundTerrain/


-Jon

OneSadCookie
2002.07.02, 12:11 AM
I think the reason SoundTerrain is no longer updated is due to difficulties porting it to MacOSX. MacOSX deals with sound interrupts quite differently to MacOS9 (they're just a preemptive thread), and I think there are race conditions, &c in that environment.

Perhaps if Ian Ollman is still reading these forums he can explain better :)

OneSadCookie
2002.07.02, 12:14 AM
And alienorb.com seems to be AWOL...

nslookup alienorb.com
Server: rachel.paradise.net.nz
Address: 203.96.152.4

*** rachel.paradise.net.nz can't find alienorb.com: Non-existent host/domain

aarku
2002.07.02, 05:22 PM
Originally posted by OneSadCookie
I think the reason SoundTerrain is no longer updated is due to difficulties porting it to MacOSX. MacOSX deals with sound interrupts quite differently to MacOS9 (they're just a preemptive thread), and I think there are race conditions, &c in that environment.

Hmm so does it work under MacOSX now or no? I'm wondering because carbonizing my game is top priority after it's complete. And it'd stink if I had to redo all of the sound code for literally the fifth time.... argh...

-Jon

hyperzoanoid
2002.07.04, 01:00 PM
hmm, what ever happened to game sprockets? i think you can use the sound one for 3d sound, but then you have to learn a little bit of carbon. I think i will go that way if i can work it.

Mazilurik
2002.07.04, 01:09 PM
Originally posted by hyperzoanoid
hmm, what ever happened to game sprockets? i think you can use the sound one for 3d sound, but then you have to learn a little bit of carbon. I think i will go that way if i can work it.

SoundSprocket is no longer available under OS X, and under 9 you'd probably be better served by SoundTerrain. It seems like the only options right now under X are CoreAudio and OpenAL, and CoreAudio is woefully undocumented (though Apple's acquisition of Emagic seems to indicate that they're going to start getting serious about audio under OS X).