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?

Victor
  • 8,309
  • 14
  • 80
  • 129

1 Answers1

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

Community
  • 1
  • 1
TaRDy
  • 999
  • 1
  • 8
  • 21