-3

Would you please give me solution due to play wav file with selected range time via C# ?

I used NAudio, but it seems not support this feature.

Thanks

Jimmy Hung
  • 13
  • 2
  • Thank for you reply. I use Naudio. i want play a audio file(wav file) with selected time . Example: i want to play a audio file from 3 sec to 5 sec. Do you have any suggestion ? – Jimmy Hung Dec 18 '14 at 10:47

1 Answers1

0

This might be what you're looking for: How do I create a seekbar in C#\NAudio Music Player? It has audioFileReader.SetPosition() and audioFileReader.Seek() which you can use to set your range.

Community
  • 1
  • 1
Nikewatch
  • 252
  • 1
  • 4
  • 15
  • Hey, i need to stop at time. i want to play from 0.4 sec to 5 sec. How i stop on time . – Jimmy Hung Dec 19 '14 at 14:50
  • @Jimmy Once you have set your position (following the advice on the above link) use a timer from that position to your end point. See Bolu's andswer here:http://stackoverflow.com/questions/4203736/stop-audio-recorder-on-its-own-after-time-delay-in-c-sharp-using-naudio he explains it very well. He's also provided code. – Nikewatch Dec 19 '14 at 15:14
  • Thank you so much. there is any way i create new file audio file with new length ? Because i need small time, about millisecond , then using timer cant reach accurately. Thank – Jimmy Hung Dec 19 '14 at 15:52
  • @Jimmy Just use Length() A really good example is here: https://www.youtube.com/watch?v=Tumpkl-xJuA It's worth having a look at his other videos too as he knows his stuff. Also there is a link to help / example files. Hope it helps. – Nikewatch Dec 19 '14 at 16:06
  • @Jimmy Brilliant. Have a great weekend :D – Nikewatch Dec 19 '14 at 16:19