Sound API of choice

Discuss programming topics for any language, any source base. If it is programming related but doesn't fit in one of the below categories, it goes here.
Post Reply
Labman
Posts: 62
Joined: Fri Nov 05, 2004 2:39 am
Location: Brisbane, Australia
Contact:

Sound API of choice

Post by Labman »

What is your sound API of choice? I'm looking into implementing sound into my game prototype engine but I'm not sure which API to look at...

Cross platform would be a big plus. Currently I'm using OpenGL and SDL, so I would like to keep my platform options open with the sound API too.
c0burn
Posts: 208
Joined: Fri Nov 05, 2004 12:48 pm
Location: Liverpool, England
Contact:

Post by c0burn »

dreadlorde
Posts: 268
Joined: Tue Nov 24, 2009 2:20 am
Contact:

Post by dreadlorde »

I'm pretty sure on Linux you will need to do some crap with ALSA and/or OSS if you want sound. I don't think you can just send sound to /dev/dsp or where ever and have it play...
Ken Thompson wrote:One of my most productive days was throwing away 1000 lines of code.
Get off my lawn!
Spirit
Posts: 1065
Joined: Sat Nov 20, 2004 9:00 pm
Contact:

Post by Spirit »

That's why you simply use SDL and as a side effect get nice libraries for networking, input etc which are easily ported to Windows and the Mac too.
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
c0burn
Posts: 208
Joined: Fri Nov 05, 2004 12:48 pm
Location: Liverpool, England
Contact:

Post by c0burn »

SDL has networking?
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Post by Spike »

the general recommendation for linux is to just use sdl for sound.
Reasoning: ALSA sucks more than the win3.1 api and has about as many bugs as there are stars in our galaxy. OSS is about as well supported as the win3.1 api, but does at least sound more like a farrari...
Really SDL is the most stress free and reliable way to get audio in linux. Be aware that it fills the output sound buffer in a separate thread, as required.
Using SDL gives you a quick and easy work around for all the bugs in the distribution's random choice of alsa version, or uses oss if the user knew how to install it and configure their system for it. It just magically works. Unlike ALSA.

I'm not personally aware of SDL having networking, but then I've never found BSD sockets to differ that much between the more important operating systems. You can generally just abstract the differences with a single header file and a few #defines.
Teiman
Posts: 311
Joined: Sun Jun 03, 2007 9:39 am

Post by Teiman »

c0burn wrote:SDL has networking?
SDL is somewhat like DirectX, has lots of "expansions".. and one is SDL_net.
Labman
Posts: 62
Joined: Fri Nov 05, 2004 2:39 am
Location: Brisbane, Australia
Contact:

Post by Labman »

I'm using SDL for window management and input currently, I was looking at it for sound but was wondering about other API's like openal might be a better choice.
calvincolins
Posts: 3
Joined: Mon Jun 28, 2010 5:06 am

Post by calvincolins »

Hey i think SDL for window management is work fine then why you want other API?
i think your current SDL is ok.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Post by revelator »

SDL_sound ;)

bitch to compile though :lol:

but it hooks into openal ogg/vorbis etc. so plenty choices.
Post Reply