-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to play/draw one channel specified by parameter #689
Conversation
|
||
for (var c = 0; c < channels; c++) { | ||
this.splitter.connect(this.merger, channel === -1 ? c : channel, c); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (channel > -1) {
this.splitter.connect(this.merger, channel);
} else {
for (var c = 0; c < channels; c++) {
this.splitter.connect(this.merger, c);
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to omit the third parameter also, but the output of splitter is only connected to the first channel of the merger (tested on newest Chrome/Firefox).
Although the last two parameters are marked as optional in the document of AudioNode.connect, the default behaviour is not described.
Nice! Does it add much overhead in terms of performance, though? |
@katspaugh Although I haven't tested its performance (and I haven't considered how to do it), the added logic seems not to include costly overhead. But I'm not sure about the splitter/merger nodes, whose performance are dependent on browser implementations. If this channel-switch function is not required by most users, we can directly connect |
Could you measure CPU load/memory usage with and without your changes? You can simply open the default OS activity monitor and watch the browser process. |
@katspaugh Good idea, will do it tomorrow. |
@katspaugh I tested its performance using Chrome's profiling tool, the increased execution time is negligible. |
Cool, merged! Thanks! |
No description provided.