If I create an AsioOut and use the MultiplexingWaveProvider it works fine (plays / disposes etc..) only if I call AsioOut.Stop() before MultiplexingWaveProvider has run out of data.
If I wait until the MultiplexingWaveProvider has run out of data (and AsioOut has triggered a PlaybackStopped event) I can't Dispose of AsioOut it just hangs and never returns (no error). Note: there is no Dispose() on the MultiplexingWaveProvider, but I've tried calling dispose on the all WaveFileReaders that are used for the MultiplexingWaveProvider.
I've had a couple of people report issues with ASIO drivers when trying to automatically stop. Probably some drivers don't like it if stop is called within the buffer swap callback.
Ideally AsioOut
should be updated to offer an option to disable auto stopping. You could simulate this by creating a never-ending ISampleProvider
whose Read
method returns silence after the end of the source has been reached. Then you could poll to see when the end of your input had been reached, and then Stop
and Dispose
when its done