A bit unclear what you mean but, if you have the complete waveform drawn into canvas and you want to click at the waveform and move the current position in the track, in general do:
// get mouse position relative to canvas
var rect = demo.getBoundingClientRect(),
x = e.clientX - rect.left;
// normalize the position
var factor = x / demo.width;
// get current position
var newPos = duration * factor;
Use newPos
for the current position on the track.