Jump to content
  • Advertisement
Sign in to follow this  
Lode

very simple audio library

This topic is 4831 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a very, very simple audio library that works for both linux and windows? It doesn't have to be able to do more than simply playing an audio file. It doesn't have to be able to load wav or mp3, because I want it to play audio from a data array I generate in memory. And it has to be stable and reliable, I mean, I just want it to have a command "play(char* audiodata)" and it must play it (and allow the rest of the C++ code to keep running while the audio is playing), without having me to set all sorts of audio parameters that are a tradeof between "noisy" or "slow response". Matlab has such a command, but I'm working in C++ here. Also, I don't want to have to link to more than one thing to be able to use it.

Share this post


Link to post
Share on other sites
Advertisement
Tried SDL? Maybe that's too simple, though. You set up the audio device and provide it with a callback function. Whenever the sound buffer is empty it calls the callback function (with a pointer to the buffer you need to write to and the number of bytes you need to give it), and you send it the next sequence of bytes.

Share this post


Link to post
Share on other sites
It could be fine, but what's a good setting for freq and samples? AFAIK these have something to do with the audio hardware? I've already worked with these before but couldn't find that setting that was just right. When I play other games it seems as if they have no trouble at all playing tons of sounds at the same time without any delay, but when I try it, I get slow responding bad quality sound...

Share this post


Link to post
Share on other sites
If you're not using SDL and want the module and/or sound playing part of the code without loading in all of the SDL overhead you might consider MikMod. It's used internally by SDL as its sound engine but functions without SDL if you want it to.

Share this post


Link to post
Share on other sites
Quote:
Original post by samuraicrow
Does FMOD work under Linux? Read the original post.


FMOD is supported under Linux, is it not? The FMOD webpage says it is anyway, I haven't tried it myself.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!