Re: [web-audio-api] (OscillatorTypeException): Setting Oscillator.type to CUSTOM should throw an exception (#105)

> [Original comment](https://www.w3.org/Bugs/Public/show_bug.cgi?id=17368#0) by Ralph Giles on W3C Bugzilla. Sun, 08 Sep 2013 00:04:41 GMT

INVALID_STATE_ERR makes sense in that type='custom' can't be set without a corresponding PeriodicWave object to use in generating the data.

However, typically setting a WebIDL enum to an invalid value just fails silently. That strikes me as less surprising, although it's no easier to handle in our implementation. The text could be clarified:

The shape of the periodic waveform. Any of the defined OscillatorType enum values may be assigned to select the corresponding waveform. The exception is "custom", which is a special value only set by the setPeriodicWave() method. Assignment of any other value is silently ignored. The default value is "sine".

---
Reply to this email directly or view it on GitHub:
https://github.com/WebAudio/web-audio-api/issues/105#issuecomment-24244214

Received on Wednesday, 11 September 2013 14:33:34 UTC