waveform-el icon indicating copy to clipboard operation
waveform-el copied to clipboard

Display a waveform and use it to navigate

I wrote this to help us select timestamps for the start and end of Q&A session recordings for EmacsConf 2021. Finding the right time in MPV was hard because it didn't have a waveform view. Audacity could show waveforms, but it didn't have an easy way to copy the timestamp. So the obvious answer is, of course, to make the text editor do the job. Yay Emacs!

#+CAPTION: Select timestamps using a waveform [[file:screenshot.png]]

It's very experimental and I don't know if it'll work for anyone else. If you want to use it, you will also need [[https://github.com/kljohann/mpv.el][mpv.el]], the [[https://mpv.io/][MPV]] media player, and the [[https://www.ffmpeg.org/][ffmpeg]] command-line tool. Here's my workflow:

  • =M-x waveform-show= to select the file.
  • =left-click= on the waveform to copy the timestamp and start playing from there
  • =right-click= to sample from that spot
  • =left= and =right= to adjust the position, =shift-left= and =shift-right= to take smaller steps
  • =p= to copy the current MPV position
  • =SPC= to toggle pausing
  • =j= to jump to a timestamp (hh:mm:ss or seconds)
  • =>= to speed up, =<= to slow down

Sacha Chua ([[[email protected]]])