2

I want to play a track (.wav file) in my Windows Forms Application. But I do not want it to play from the beginning, but from a certain point somewhere in the track (let's say 10 seconds). To play the track from beginning is no problem:

private void playSimpleSound()
{
    SoundPlayer simpleSound = new SoundPlayer(@"c:\Windows\Media\sound.wav");
    simpleSound.Play();
}

But how can I skip the first 10 secons, and play only the rest of it?

Thanks in advance!

Uğur Aldanmaz
  • 1,018
  • 1
  • 11
  • 16
marius
  • 163
  • 1
  • 2
  • 16
  • Is there any reason you cannot create a second wav file from the first that you edit to start where you want it to? – juharr Sep 16 '14 at 19:47
  • Not with SoundPlayer, no, but there are many other libraries you could use to do so. – JWiley Sep 16 '14 at 19:51

1 Answers1

1

SoundPlayer class not to support to do this. It gives a very simple control on WAV files. Maybe this question can help you.

Community
  • 1
  • 1
Uğur Aldanmaz
  • 1,018
  • 1
  • 11
  • 16