   sound and mp3s
  I'm loading mp3's with DirectShow.  I build an IGraphBuilder with the mp3, then query to get the IMediaControl, IMediaSeeking, IBasicAudio, and IMediaEvent.  I can't seem to find a solid solution for repeating and looping sounds.  The only option I see is to poll the start/end positions and restart the sound when they are equal.  This works fine, but can lead to small timing issues (up to 1/60 of a second PER REPEAT, and that is assuming our framerate never drops).  Since these are going to be heavily layered sounds, small imprecisions will destroy the quality.A couple of plans I have to eliminate these timing issues:A) Spawn a dedicated thread to poll the start/end positions more often.B) Start each sound based on an absolute timing (the timing could still be off by the frametime, but the imprecision will not grow with the next iteration.It would be nice if there was a repeat option like the WAV performance structure.Any suggestions?   
  I know I solved this by hacking apart the DShow samples a while back...I just had a look in my PSDK; Look at the file \Samples\Multimedia\DirectShow\Players\PlayWnd\playwnd.cpp - the function, HandleGraphEvent(), starting on line 841 should be of interest.It checks the event codes (also, read this section) for an EC_COMPLETE - I presume that you could also wait for this and trigger your restart.They seem to be using IMediaEventEx instead of IMediaEvent that you mentioned. Maybe thats an angle to explore?However - you'll still get timing events as you've got to wait for your application to receive/process the forwarded events. Which means you're almost certainly going to get a delay of 1 frame (or thereabouts)...Proper hard real-time programming is not easy - if you really need no gaps/delays you're probably gonna end up doing a lot of work yourself (e.g. queueing up and buffering...)hthJack   