Allow consumers to initialize StereoBlanceNode value a la StereoPannerNode

This commit is contained in:
Jordan Eldredge 2019-02-26 07:23:10 -08:00
parent 522609fa5e
commit 182b4d0024

View file

@ -1,7 +1,7 @@
// The Web Audio API does not offer an easy way to make a stereo balance
// control. This is an attempt to fill that void, using an API similar to
// [StereoPannerNode](https://developer.mozilla.org/en-US/docs/Web/API/StereoPannerNode)
export default function StereoBalanceNode(context) {
export default function StereoBalanceNode(context, options) {
let balance = 0;
// ChannelSplitterNode cannot be told to use a `channelInterperatation` of
@ -74,5 +74,9 @@ export default function StereoBalanceNode(context) {
}
});
if (balance !== options.balance) {
set(options.balance);
}
return upMixer;
}