First I like to write: I am new to this forum.
The forum looks very good but why do I first have to click on a message before I can click on ‘new post’ ??? I would expect the ‘new post’ button to be one screen back…
Now about my game/sound problem:
I have just started to use FMOD and SOUND in general.
I have written a small game. I like FMOD because it seems to be quality and it is easy.
My first attempt at introducing sound to my game is hilarous to say the least.
Let me explain:
My game has 16 ships, which fly around and each ship fires about 10 bullets per second (5 x 2 bullet side by side).
So in fact: 16*10 = 160 bullets flying around per second.
Also ships constantly explode and respawn.
So that’s why my first attempt was hilarous.
I did it like this:
every time a bullet is fired a sample is played and every time a explosion occurs a explosion is played.
The funny thing is FMOD can only handle 32 channels/sample at a time.
So I can only hear the lasers and not the explosions.
So the problem in short is: too much sound going on at once.
I can imagine different solutions to this problem.
My first idea was only playing the sounds which are caused by the player.. but this seems lame.
So I quickly started thinking about another solution… for example reducing the number of samples that can be played…
So I could imagine the game timing the sounds/samples. Maybe my game code has to know when a sample can be played.
Or maybe the problem is to much laser samples and to little explosion samples…
so the lasers make to much sound.
So my game could control when it is ok to play a laser sound. For example a laser sound may only be played when the previous laser sound is finished ?
So this could be done with timing or some sort of functions… ?
To do timing… I need to know how long it takes to play a sample… and it would be cool if FMOD can return the time it takes to play a sample.
( in seconds, milliseconds or microseconds )
So in fact my question(s) are really short and simple:
Can fmod return the time it takes to play a sample ?
And which function is it ?
Can fmod return when it is done playing a sample ?
And which function is it ?
<font size=-1>[ This Message was edited by: skybuck on 2002-04-02 15:32 ]</font>
Another option is to set the priority of the explosions to be higher than that of the lasers.
I assume that the explosions are less frequent than the lasers(less than 10 a sec) so a few missed laser sounds here and there probably wouldn’t be missed. With the higher priority, the explosions would edge out the lasers if there weren’t sufficient channels available.
If you want to justify it to yourself, you can say that the explosions are so loud that they drown out the sound of the lasers. Play with it and see how it works. Should be a lot less work than timing everything.
- Karg answered 17 years ago
Please login first to submit.