23445

Windows Form: Play sound, but not from beginning

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!

Answer1:

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

Recommend

  • How can I stop AVAudioPlayer from repeating before it reaches the end of my data?
  • SoundPlayer adjustable volume
  • Proper fix for Java 10 complaining about illegal reflection access by jaxb-impl 2.3.0?
  • Sound not playing in my application
  • Play PCM data in .NET Framework 2?
  • Issue to parse json
  • Mix .L and .R files into a stereo file using SOX in bulk
  • Numpy: conditional np.where replace
  • Play a sound using python subprocess and threading
  • How do I add some other audio to the muted section of an audio using ffmpeg?
  • How to insert silence into an audio file with programming?
  • How to change imagesize to allow longer audio (wav to png)
  • Windows Form: Play sound, but not from beginning
  • How do I start a tone and let it run indefinitely till i stop it explicitly?
  • Why does audio work in the simulator but not on my iPad?
  • Convert .wav file to binary and then back to .wav?
  • Preloading sound in kivy
  • Read a sound backward with DirectSound
  • C# String Filepath Question
  • Asterisk IVR After Hangup
  • preg_replace Double Spaces to tab (\\t) at the beginning of a line
  • print() is showing quotation marks in results
  • Q promise. Difference between .when and .then
  • formatting the colorbar ticklabels with SymLogNorm normalization in matplotlib
  • Illegal mix of collations for operation for date/time comparison
  • Android screen density dpi vs ppi
  • How would I use PHP exceptions to define a redirect?
  • How to extract text from Word files using C#?
  • Join two tables and save into third-sql
  • How to model a transition system with SPIN
  • Javascript + PHP Encryption with pidCrypt
  • ORA-29908: missing primary invocation for ancillary operator
  • retrieve vertices with no linked edge in arangodb
  • Getting Messege Twice Using IMvxMessenger
  • need help with bizarre java.net.HttpURLConnection behavior
  • Checking variable from a different class in C#
  • How can i traverse a binary tree from right to left in java?
  • failed to connect to specific WiFi in android programmatically
  • Converting MP3 duration time
  • How can I use threading to 'tick' a timer to be accessed by other threads?