Sign in to follow this  
CoderGuy

Sound effects question

Recommended Posts

CoderGuy    130
The way our project is currently set up is that we will have to load all the sound effects ahead of time using OpenAL. All the tutorials we've seen have the sound effects all loaded at once during initialization. Is this how it is normally handled in games? Can we load up a sound effect when it is needed but yet have it be able to be played while other sound effects are going on?

Share this post


Link to post
Share on other sites
anthemaudio    301
Usually the SFX are in fact stored directly into RAM. Depending on RAM budgets and file size of SFX I've seen them streamed before, but it's not the best way to go typically...

If for sure a specific sound effect isn't going to be used then I'm sure you can dump it from the buffer if you're trying to squeeze in another sfx.

Do you have some RAM limitiations with something or what?

Tony

Share this post


Link to post
Share on other sites
CoderGuy    130
Thanks for the info...I do not have any problems with memory, I have just never programmed the music side and all the examples that I have seen load them at the same time. I wanted to know if that was the normal way of doing it for games or if there were better ways.

Thanks for the help

Share this post


Link to post
Share on other sites
hplus0603    11356
Disk I/O of any kind during a game level will typicall cause a glitch in the frame rate; it's a very noticeable jerk when that happens. Thus, most games pre-load everything they'll need for a level.

Some games, notably those with extremely large, "streaming" or "paging" worlds, will load and unload data as needed, and will use asynchronous I/O (on UNIX), overlapped I/O (on Windows), or a separate disk loading thread (any platform) to get rid of that glitch, because most of the glitch is just spent doing nothing while waiting for the call to read() to return (which in turn is waiting for hardware, so the CPU is idle).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this