play.js, record.js: improve error handling
waveform.js: Reset the wavform size each time it's generated