waveform: use OptionsError types for nil function and zero resolution in Waveform.readAndComputeSamples