Is there any way to get the number of milliseconds that have passed since the soundplayer started playing?
So far I\'m using Environment
\'s tick counter by
No, the SoundPlayer
class has no way to read it's current position. It's a very simple "fire-and-forget" WAV player that's not meant for anything too complicated.
If you need more control over your sound playback you should be using something like the Windows Media Player control, as described in this article. In particular, there is an IWMPControls::currentPosition property you can get from the media player to tell you where in the current media the player is.