Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

NamelessTwo

Sound Manager

This topic is 5394 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

How do you, people, handle your sounds? Sound Managers? What should be a good sound manager? Are there special articles or source code that explain that topic nicely? Thank you!

Share this post


Link to post
Share on other sites
Advertisement
You probably don''t want to hear this but the best resource I''ve seen on this topic is a book titled ''Game Audio Programming'' by James Boer, published by Charles River Media (the Game Programming Gems publishers). The book goes into great detail on audio engine design and implementation. The sample library on the disk can be used as-is in any of your projects, or as a starting point to code your own. Additionally, you get some great material on DirectAudio, ogg vorbis, basic audio theory, and solid design concepts. I can''t recommend that book enough.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I took a simple approach and it works really well.

The manager simply keeps a list of sounds in memory and assigns them all an ID number. As long as you have the ID number you just tell it "play sound 6". etc etc.

You can set all of the necessary properties through the manager: volume, location, load a sound, unload a sound, blah blah.

Share this post


Link to post
Share on other sites
In all the projects I've ever written I have a sound manager which contains a list of sound effects. I can get a sound effect by finding it using a name, or an ID. Once I have a sound effect I can play it, stop it, set its pitch or its volume, duplicate it, or unload it.

The only extension to this is that I normally load and unload samples in 'banks'; collections of sounds. This lets me narrow my search when I am trying to find a sample ie. look in bank 'footstep' for 'foot on gravel' instead of looking through all the sounds loaded.

I also have a concept of a 'group' which is a collection of sound effects that get played either incrementally, decrementally, or in random order.

[edited by - Sphet on January 14, 2004 2:34:49 PM]

Share this post


Link to post
Share on other sites
Could someone post some code?
I''m trying to make a Game in Delphi/DelphiX and the soundthing is going to be a problem as my TMediaPlayer isnt working. So how can I load, play, stop, fade, manage sound? (mp3, ogg, ...)

Share this post


Link to post
Share on other sites
quote:
Original post by Flogo
Could someone post some code?
I''m trying to make a Game in Delphi/DelphiX and the soundthing is going to be a problem as my TMediaPlayer isnt working. So how can I load, play, stop, fade, manage sound? (mp3, ogg, ...)

This question isn''t too related to the topic ("playing a sound" rather than "how to organise sounds together for use in a game"). I''d advise you to ask over at DGDev. The answer depends on what you want to use really (FMod, BASS, OpenAL, DirectSound, MCI, or other APIs). There''s no one answer here.

... and we now return you to your regularly scheduled thread, NamelessTwo

Share this post


Link to post
Share on other sites
I really am quite suprised that there hasn''t been a sound manager/engine released to the gamedev community. The actual low-level API used for playback is totally seperate from the way the sound effects themselves are managed. Is there nothing out there?

Share this post


Link to post
Share on other sites
uhm, what do you mean sphet?

The manager seems fine to me

I would make an interface of some sort:


class ISoundSystem {
virtual PlaySound(...);
virtual LoadSound(...);
virtual UnloadSound(...);
virtual PauseSound(...);
virtual ResumeSound(...);
//...You get the point?
}


And then have some dll or something with the actual implementation of the interface.

You could have some SoundManager that keeps track of all the sounds and ISoundSystem interfaces available... and then just choose which interface//dll to use and play the sound. The SoundManager could take care of loading packed soundfiles etc...

ISoundSystem& sound =SoundManager::QueryInterface("DirectSound");
if(not error...)
sound.PlaySound("nice.mp3");

Sphet: was something like that what you mean?
Now the implementation is hidden from the user. Only the Interface is available, which I think is not so low lvl anymore.

This way you can easily load different soundsystems, like DirectSound or whatever.

[edited by - bilsa on January 15, 2004 12:31:13 PM]

Share this post


Link to post
Share on other sites

  • 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!