Handling multiple sounds
Note: This thread was split off from this thread.
Yes, I'm a bit worried about that. (It depends entirely on the sound, and on the delay between them, however.) Fading the first might be a good idea, but I'm a bit worried about the sound sounding cut off there too.
This sounds like it is going OT, so I'll be brief. Yes, or course you are right in your approach using three channels 'per sound'. What triggered my thinking was the fact that with my old architecture, each instance of, say, a monster, would carry around a copy of that monster type's entire sound set. For a monster with a gun sound and a dying sound, that could easily mount up to a 100 sound instances with 50 enemies.
Oh, well, I'll try this and see where I end up.
Quote:I think you may get a stuttering effect, depending on the sound, because you are restarting it each time. It might sound better to let the first one fade, then play the trailing end of the follow-up explosion?
Yes, I'm a bit worried about that. (It depends entirely on the sound, and on the delay between them, however.) Fading the first might be a good idea, but I'm a bit worried about the sound sounding cut off there too.
This sounds like it is going OT, so I'll be brief. Yes, or course you are right in your approach using three channels 'per sound'. What triggered my thinking was the fact that with my old architecture, each instance of, say, a monster, would carry around a copy of that monster type's entire sound set. For a monster with a gun sound and a dying sound, that could easily mount up to a 100 sound instances with 50 enemies.


It sounds like your current sound system is really messed up! 
Why don't you just reimplement it so that you have a library containing one instance of each sound, a set of channels, and a way of playing a sound on the next free channel?

Why don't you just reimplement it so that you have a library containing one instance of each sound, a set of channels, and a way of playing a sound on the next free channel?
Quote:It sounds like your current sound system is really messed up
...which is the reason I ripped it out in the first place.

Which brings me to a real topic for this thread - how would you create maximum depth with your sounds? I'm working on a solution (very common solution, too) similar to detail texturing - play a looping sound, and then put another loop on top of it of another length. That way, they will rarely repeat (depending on sample length).
Anyone have another neat-o method for killer sound?
SWF? Why would you use SWF? I've never seen a game use SWF (Besides a Flash game. In which I don't think your doing) Isn't SWF Macromedia Flash? You would need to like get some kind of SWF decoder library from Macromedia, and maybe even have to get permission to use it. Or is that a typo?.... Or am I just incredibly stupid. I dunno.
SWF is very good for hand-drawn animations, which the game is all about. And no, there's no licencing fees, since I play them through QuickTime, which means Apple already did that for me.
But yes, we use flash movies as cut-scenes.

Quote:Originally posted by Fenris
...which is the reason I ripped it out in the first place.QuickTime isn't very easy to get a grip on (I don't think it even does channels in the traditional way) - right now I'm hunting flies with a bazooka.
Right... I really don't understand QuickTime, which is why I'm still using snd resources and the Sound Manager. I'd like to be able to support external sound files (AIFF and so on), but I don't fancy wrestling with QuickTime's hideous API so I'll probably try to find some other way of doing it.
Quote:Which brings me to a real topic for this thread - how would you create maximum depth with your sounds? I'm working on a solution (very common solution, too) similar to detail texturing - play a looping sound, and then put another loop on top of it of another length. That way, they will rarely repeat (depending on sample length).
Anyone have another neat-o method for killer sound?
I'd be interested to see how your idea turns out. I can see one possible problem: you'd have to make sure the main sound and the detail sound weren't derived from the same original sample or you might get beating interference patterns. Ever heard that thing where you play the same explosion sound twice in quick succession and it comes out sounding really strange? Things like that could happen.
I don't have any really good suggestions for doing more interesting things with sounds, but you could try dynamically shifting the pitch of sounds as they play to give them a more irregular, organic feel. You could also try using a spatial sound API to get better effects.
If the licensing works for you, try FMOD. I recently started using it and can honestly say I will never use anything else for game audio.
Your multiple sound instance problem can be fixed pretty quickly with FMOD - load a sample once, and assign a pointer for each object that will play it. You then manipulate the sound though channels, rather than messing with the actual sample.
Your multiple sound instance problem can be fixed pretty quickly with FMOD - load a sample once, and assign a pointer for each object that will play it. You then manipulate the sound though channels, rather than messing with the actual sample.
No, licensing is unfortunately not OK - I will use fMod in the future, though. It rocks. 
I'm looking at maybe switching to the old Sound Manager for sound effects, and keeping QT for movies and music... that would probably do the trick.

I'm looking at maybe switching to the old Sound Manager for sound effects, and keeping QT for movies and music... that would probably do the trick.

Quote:Originally posted by Fenris
I'm looking at maybe switching to the old Sound Manager for sound effects, and keeping QT for movies and music... that would probably do the trick.![]()
This may be old news to you, but I've just found this example on Apple's website which has two interesting functions:
SndSnip_PlayWAVEFileWithQuickTime() loads a .wav file using QuickTime, but could be changed to load any audio format. It puts the sound into a Movie handle and plays it with StartMovie().
SndSnip_ExtractSoundTrackIntoHandle() takes a Movie handle and turns it into something which can be played with the Sound Manager's SndPlay() function.
Mix those two functions together and you can load any sound format from disk and play it with the Sound Manager, and that solves the problem I mentioned in my last post!
_That_ I didn't know. Very helpful indeed!
Really great news, thanks!

