I have a problem knowing when a source stream has stopped playing. If one is playing a single source stream into a WaveOut device then it is easy, just catch the event the WaveOut raises. My signal chain is a little more complex than that since I have multiple source streams being played through a mixer to the WaveOut. Basically what I have is Other providers may be added later):
<AudioFileReader><FadeInOutSampleProvider><MixingSampleProvider><WaveOut>
The MixingSampleProvider can have multiple inputs.
The FadeInOutSampleProvider I have modified to return zero bytes when it enters "Silence" state.
My issue is that I need to know when the source is silenced at the end of a fade out so that the source and that signal chain may be disposed where necessary. The fade out can occur at almost any time because the application sequences a number of files and some of the files are marked to be "exclusive" so any playing file must be faded out and then any resources used by it disposed.
Is there a way of detecting this? It seems that the "MixingSampleProvider" is almost doing this when the "ReadFully" property is true, it removes the input from the mixer. Maybe a solution is to add an event when this occurs?
Any ideas would be much appreciated,
Sid
<AudioFileReader><FadeInOutSampleProvider><MixingSampleProvider><WaveOut>
The MixingSampleProvider can have multiple inputs.
The FadeInOutSampleProvider I have modified to return zero bytes when it enters "Silence" state.
My issue is that I need to know when the source is silenced at the end of a fade out so that the source and that signal chain may be disposed where necessary. The fade out can occur at almost any time because the application sequences a number of files and some of the files are marked to be "exclusive" so any playing file must be faded out and then any resources used by it disposed.
Is there a way of detecting this? It seems that the "MixingSampleProvider" is almost doing this when the "ReadFully" property is true, it removes the input from the mixer. Maybe a solution is to add an event when this occurs?
Any ideas would be much appreciated,
Sid