   Common Sound Managment Questions With DirectSound/DirectShow
  1) I have a question about common sound management in the game app: Do you load the sounds (= create the sound buffers) required for the level at initialization time and play them when needed? Or do you create them directly when you need them? The first method has the disadvantage, that you cannot play the same sound when it is already playing, so you have to wait for it to stop in order to play it again. What is the common way to handle this?2) When to release sounds from memory? If you create a sound buffer every time  you need a sound to be played, you have to somehow know when the sound is over so that you can release them from memory. But how can you find out if you have a simple createAndPlaySound(filename) method which locally creates the sound buffer? That means the sound buffer cannot be referenced anymore in the future and there is no way to release it anymore. I think this is the disadvantage of the second method described in question 1. Because on the other hand, if you load all sounds at level initialization, you know exactly which sounds to free at level shutdown/change... 3) The fact that DirectSound cannot play compressed audio files like mp3 is very annoying, so I read that this is usually done in games with DirectShow. I tried to create a simple (GraphBuilder, MediaControl, MediaEvent)-triple and play a mp3-music file with it. It took multiple seconds for the file to load. Is there a simple way around? I thought the files would get streamed, then why does it still take so long to start playing? (Smaller mp3 files start immediatly)4) I want my sound effects as mp3 files as well. So does that mean I have to create multiple instances of the Graph Builder object and for each instance additionally one MediaControl and MediaEvent object?5) When I play Sound/Music with DirectShow, the sounds can even be heard if the application is ALT-TABBED. This is not the case with DirectSound. Is there a way to change this?   
well, we have solved the first couple questions you have. loading sounds from disk all the time for each new instance will kill you. we use the dsound function DuplicateSoundBuffer() to enable us to play the same sound simultaneously on differnt instances. this is super fast to create, and super small memory footprint for the duplicates. you just have to code a bit of logiic into you sound class to handle the duplication.-programmer_tom   ;  @programmer_tom: Thank you for your help, I'll try that out.Can anyone help me with the other questions?Oh and changing frequency, amplitude and panning with streaming sound buffers does not work for me. The strange thing is though, I don't create them that differently from the static buffers, and for the static buffers changing frequency etc. works just fine... Any suggestions?   ;  1) You can load all the sounds on the start of your application and use DirectSound's buffer management.2)  Depending on the size of your game, you do not need to release sounds until the game is exited.  This is DS buffer management's strength.3)  You will have to code your own for this.  DirectShow is good, but slow.  I would recommend looking at OGG Vorbis for streaming sounds/music.  It works really well and, IMHO, has better quality than MP3.4)  I would not do this.  A small sound like a gunshot or a footstep is unnecessary to compress and uses unnecessary cycles to uncompress.  I would leave large sounds for compressing and leave everything else WAV files.5)  You have to set the cooperative level to DSSCL_PRIORITY instead of DSSCL_EXCLUSIVE.   