Player crashes when web playback is stopped
Currently, the player crashes whenever a file is loaded during or after a stream is played.
Steps to Replicate
- Open an MP3 stream (you can use this Soma.fm stream to test).
- Press stop button to stop the stream from playing.
- The player will crash.
Stack Trace:
System.InvalidOperationException: Seeking is not supported for this sound.
at SoundFlow.Components.SoundPlayer.Seek(Int32 sampleOffset)
at SoundFlow.Components.SoundPlayer.Stop()
at MusicSharp.AudioPlayer.SoundFlowPlayer.Play(Stream stream) in /MusicSharp/src/AudioPlayer/SoundFlowPlayer.cs:line 30
It appears that the error is due to the SoundFlow library's Stop() method running in the AudioEngine class. According to the SoundFlow library documentation, Stop() should work for web playback.
I've opened an issue in the SoundFlow repository for this as it appears to be a bug in the SoundFlow library itself.
After speaking with the SoundFlow developer, this issue should be resolved when the next version of the SoundFlow library is released.
This bug was resolved in SoundFlow version 1.0.4. I've updated the library to 1.1.1 today and so I can mark this issue as closed.