I’m using [y, Fs, nbits, opts] = wavread(filename) to read in a wave file. Next I plot(t, y) where t = 0:1/Fs:(length(y)-1)/Fs. I play the wav via sound(y, Fs). My question is, is there a way to have a marker of some sort displayed in the plot that is synced with audio from the wav? I am hoping to listen to the audio while observing where in the plot the corresponding sound is via a marker that moves within the plot.
I’m using [y, Fs, nbits, opts] = wavread(filename) to read in a wave file.
Share
Below is a solution with good synchronisation. This works well because the
audioplayerobject is initiating the callback that updates the play head location. Here is the calling script . . .…and here is the callback function that you can store in a separate file …
I have just made the signal a noise sample that you can replace with whatever you like. It is a shame that the
audioplayerobject hasstopandresumemethods without any access to a current play head location. Fortunately, there is a user data property that allows you to cram in whatever you like.