2

I have generated waveform using How to render audio waveform? answer from Illaya and displayed on picturebox, now i want to play sound at specific point (mark on waveform), i have used NAudio for waveform.

Screenshot can explain all things:

enter image description here

Community
  • 1
  • 1
Sunil Dabhi
  • 99
  • 2
  • 13

1 Answers1

1

The main idea to play from that point is you should know the seconds or milliseconds value for that point. For example I use media player control to play a file and this way, I make the player to play from second 100:

this.axWindowsMediaPlayer1.URL = "path to my file";
this.axWindowsMediaPlayer1.Ctlcontrols.currentPosition = 100;
this.axWindowsMediaPlayer1.Ctlcontrols.play();
Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398
  • thanks for edit question and quick answer, but for bars(lines to play) which control should i use, because user can able to move that bars on the waveform – Sunil Dabhi Oct 02 '15 at 14:22
  • @SunilDabhi You are welcome. I think there are different ways to do it, for example you can create your custom control and handle that lines or you can uses `TrackBar` to handle it. – Reza Aghaei Oct 02 '15 at 14:23
  • thanks its helpfull for me i will try and let you know – Sunil Dabhi Oct 02 '15 at 14:29
  • @SunilDabhi But since the post answers your question about **How to play mp3 at specific point over waveform?** I think if my comment is not enough for you about how to use such handles, it's better to ask a new question about doing such job and keep this question clean and specific. – Reza Aghaei Oct 02 '15 at 14:29