mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 00:59:29 +00:00
Allow consumers to initialize StereoBlanceNode value a la StereoPannerNode
This commit is contained in:
parent
522609fa5e
commit
182b4d0024
1 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue