WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
78043
Make it possible to create JavaScriptAudioNode-based Web Audio nodes
https://bugs.webkit.org/show_bug.cgi?id=78043
Summary
Make it possible to create JavaScriptAudioNode-based Web Audio nodes
Boris Smus
Reported
2012-02-07 14:45:06 PST
I'm trying to create a custom node based on the JavaScriptAudioNode by extending its prototype with a custom function, and then plugging it into the audio graph. Unfortunately, doing this causes a "SyntaxError: Invalid destination node" error, and the audio graph rejects the custom node. Here's what I'm doing: 1. I extend the context with a createCustomNode call, as follows: // Augment the context with a createMeterNode call that returns an augmented // JavaScriptAudioNode. function registerCustomWebAudioNode(context, constructorName, classObject) { // Get the webkitAudioContext and extend its prototype. webkitAudioContext.prototype[constructorName] = function() { var customNode = new classObject(this); customNode.prototype = context.createJavaScriptNode(2048, 1, 1); return customNode; } } function MeterNode(context) { console.log('init'); } MeterNode.prototype.onClip = function(callback) { // ... }; 2. Then, I'm using the custom node as follows: // Assuming context, source are initialized earlier. meter = context.createMeterNode(); // Connect source to meter node to destination. source.connect(meter); meter.connect(context.destination); 3. I get an error: SyntaxError: Invalid destination node This sounds like something at the JavaScript - C++ bindings layer.
Attachments
Add attachment
proposed patch, testcase, etc.
Raymond
Comment 1
2012-04-05 01:03:09 PDT
Interesting, just curious on your implementation. Do you have full source code on how you call registerCustomWebAudioNode and use MeterNode etc.?
Chris Rogers
Comment 2
2013-05-10 17:48:21 PDT
It appears that extending the prototype like this is very hard or impossible to do given the way the JS bindings system works
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug