Moving playback position when clicking the waveform analyzer

Started by NadiaDj, August 02, 2014, 09:47:09 AM

Previous topic - Next topic

NadiaDj

Hi,

I would like to know if there is the possibility to automatically move the current playback position to the same position clicked through the left mouse button over the waveform area of the analyzer.

Thanks in advance

Nadia

Administrator

Hello Nadia,

yes this is possible and quite easy to implement.

When the user clicks the waveform area you can catch the WaveAnalyzerMouseNotification event and check the e.nAction parameter: if its value is MOUSE_ACTION_LEFT_CLICK and playback should be already started, you could take the value of the e.nPressPosInMs parameter and use it in this way:



  audioSoundEditor1.SeekSound (e.nPressPosInMs, enumScaleUnits.SCALE_MILLISECONDS);



In case playback shouldn't be already started you could use:



  audioSoundEditor1.PlaySoundRange(e.nPressPosInMs, -1);



where -1 indicates to play till the end of the sound.

Kind regards

Severino Delaurenti