0

I'm using the System.Media.SoundPlayer for playing sounds in C# desktop application passing the sound location.

Everything works fine. But how can I access the total file length (in milliseconds) and the player position?

Theses properties are accessible?

4

1 回答 1

2

The System.Media.SoundPlayer class is not suitable for providing this information.

http://msdn.microsoft.com/en-us/library/system.media.soundplayer.aspx

The SoundPlayer class provides a simple interface for loading and playing a .wav file. The SoundPlayer class supports loading a .wav file from a file path, a URL, a Stream that contains a .wav file, or an embedded resource that contains a .wav file.

You may want to look at some other libraries for audio playback, suggested here: C# Audio Library

于 2013-01-30T14:07:52.467 回答