Audio in game

Hello,

I use SDL as main lib for my game.

When it came to graphics, I immediately came to OpenGL (as I have a
vast experience of it, and I love it and, and, I married it:P)

But, for audio, I lack experience. Actually, I never player a sound
in a programme I made myself (except if terminal beep count).

So, I read a lot of discussions here and there, and I was able to
grab the following info, only problem, I have no idea if anything of
this is true:

  • OpenAL is bad because totally broken on MacOS X (osx is my primary
    OS, but it should work on win, osx and linux)
  • SDL audio support sucks (not my words, I have NO idea)
  • Core-Audio on macosx is nice, very powerful, but super hard to
    code, and this is no go because I want a portable solution.

So, as you can see, even after quite some time trying to find a piece
of info, I found nothing worth it.

Basically, my needs are a 3d audio library. I want to input where the
sound is, the sound parameters (pitch, gain…) and call play.

Best regards–
Kuon

“Your computer requests another OS, deny or allow?”
“You should stop playing with that, or it will eventually works.”

Company website:
http://www.goyman.com/

Personal blog:
http://arkhi.goyman.com/blojsom/blog/default/

Why not start with some 2d audio like SDL_Mixer until you get more
confortable with it?

ChrisOn 4/18/07, Kuon - Nicolas Goy - ??? (Goyman.com SA) - 675 wrote:

Basically, my needs are a 3d audio library. I want to input where the
sound is, the sound parameters (pitch, gain…) and call play.


E-Mail: Chris Nystrom <@Chris_Nystrom>
Saving the world from web programming.
http://www.newio.org/ - AIM: nystromchris

  • OpenAL is bad because totally broken on MacOS X (osx is my primary
    OS, but it should work on win, osx and linux)

This has not been my experience on the Mac.

  • SDL audio support sucks (not my words, I have NO idea)

The “support” is fine, it works everywhere you might use SDL, but it’s
very lowlevel…you should expect to write your own mixing routines, or
use ones built on top of SDL…all SDL does is give you a way to put
final, mixed bits to the audio hardware.

Most people should really know what they’re doing and expect to work
hard if they target SDL audio directly. It’s usually wiser to find a
higher-level audio library built over it.

Between the three: OpenAL, SDL, and CoreAudio, I recommend OpenAL to
most people. On Linux, OpenAL very well might use SDL for accessing the
audio hardware behind the scenes anyhow. :slight_smile:

–ryan.

So, I read a lot of discussions here and there, and I was able to
grab the following info, only problem, I have no idea if anything of
this is true:

  • OpenAL is bad because totally broken on MacOS X (osx is my primary
    OS, but it should work on win, osx and linux)

Not true anymore in my experience. The original OpenAL that shipped
with Tiger was based on the 1.0 API (because 1.1 was going through
ratification at the same time). The 1.0 spec had some fundamental
flaws plus Apple had some bad bugs in their implementation. But now
that OpenAL 1.1. is here and Apple has shipped their update to support
this, things are pretty good now. They fixed all the bad bugs I know
of.

  • Core-Audio on macosx is nice, very powerful, but super hard to
    code, and this is no go because I want a portable solution.

Basically, my needs are a 3d audio library. I want to input where the
sound is, the sound parameters (pitch, gain…) and call play.

Apple’s OpenAL implementation is built on top of CoreAudio. If OpenAL
does what you need, just use OpenAL.

-Eric

  • OpenAL is bad because totally broken on MacOS X (osx is my primary
    OS, but it should work on win, osx and linux)

This has not been my experience on the Mac.

  • SDL audio support sucks (not my words, I have NO idea)

The “support” is fine, it works everywhere you might use SDL, but it’s
very lowlevel…you should expect to write your own mixing
routines, or
use ones built on top of SDL…all SDL does is give you a way to put
final, mixed bits to the audio hardware.

I think this is perfectly fine, and it’s the philosophy of SDL, I
thought it was bugged or anything.

I will go with OpenAL as it’s a bit like OpenGL, and I’m very
comfortable with OpenGL.

But as Chris said in it’s earlier email, I will play with mixer a
bit, to get comfortable with sounds.

Thanks for your input.

RegardsOn 19 Apr 2007, at 2:52 AM, Ryan C. Gordon wrote:


Kuon

“Your computer requests another OS, deny or allow?”
“You should stop playing with that, or it will eventually works.”

Company website:
http://www.goyman.com/

Personal blog:
http://arkhi.goyman.com/blojsom/blog/default/

This is a good place to start:

http://www.kekkai.org/roger/sdl/mixer/

ChrisOn 4/19/07, Kuon - Nicolas Goy - ??? (Goyman.com SA) - 675 wrote:

But as Chris said in it’s earlier email, I will play with mixer a
bit, to get comfortable with sounds.


E-Mail: Chris Nystrom <@Chris_Nystrom>
Saving the world from web programming.
http://www.newio.org/ - AIM: nystromchris