W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2013

Re: [web-audio-api] (ExceptionType): Undefined exception type (#106)

From: Olivier Thereaux <notifications@github.com>
Date: Wed, 11 Sep 2013 07:29:37 -0700
To: WebAudio/web-audio-api <web-audio-api@noreply.github.com>
Message-ID: <WebAudio/web-audio-api/issues/106/24244223@github.com>
> [Original comment](https://www.w3.org/Bugs/Public/show_bug.cgi?id=17325#1) by Philip J├Ągenstedt on W3C Bugzilla. Thu, 26 Jul 2012 12:40:09 GMT

The createBuffer method could be written as:

If numberOfChannels is greater than 32, if sampleRate is less than 22050 or if sampleRate is greater than 96000, then throw an IndexSizeError. Otherwise, return a new AudioBuffer with sampleRate *sampleRate*, length *length*, numberOfChannels *numberOfChannels*, where all samples have the value 0.

IndexSizeError works for most of these range-checks. For noteOn and other places that check state, InvalidStateError is appropriate.

If exceptions are ever thrown in an algorithm with multiple steps, the magic words "and terminate these steps" must be included as noted in http://wiki.whatwg.org/wiki/Howto_spec#Dealing_with_exceptions

---
Reply to this email directly or view it on GitHub:
https://github.com/WebAudio/web-audio-api/issues/106#issuecomment-24244223
Received on Wednesday, 11 September 2013 14:34:17 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:11 UTC