Re: [web-audio-api] It makes no sense to use EventListener for onaudioprocess if ScriptProcessorNode isn't EventTarget (#116)

> [Original comment](https://www.w3.org/Bugs/Public/show_bug.cgi?id=20764#4) by Ehsan Akhgari [:ehsan] on W3C Bugzilla. Tue, 19 Feb 2013 06:12:01 GMT

(In reply to [comment #4](#issuecomment-24244301))
> (In reply to [comment #3](#issuecomment-24244297))
> > Also, in that case, we should rename onaudioprocess for consistency as well.
> 
> This would be a breaking API change for shipping versions, so we'd have to
> be careful to move it to the "deprecated" and recommended section if we
> thought it important to change.  Personally, I don't think there's any
> reason it can't still be called onaudioprocess even though it has nothing to
> do with EventListener

webkit can still support the old API I guess, but the onXXX naming convention is used throughout the web platform for things using event targets, and using such a naming scheme will be very surprising to all web developers, so I think that is a really bad idea.

Also the usage of callbacks can enable us clean up the API by accepting the callback as an argument to the createScriptProcessor function, which makes it unnecessary to expose it on ScriptProcessorNode at all.  Speaking of which, I don't think exposing bufferSize on that node type makes much sense either.

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

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