mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 17:47:16 +00:00
Allow SteroBalanceNode to accept a string
This commit is contained in:
parent
d2f05768f0
commit
522609fa5e
1 changed files with 2 additions and 1 deletions
|
|
@ -32,7 +32,8 @@ export default function StereoBalanceNode(context) {
|
|||
rightGain.connect(merger, 0, 1);
|
||||
|
||||
// -1 (left) to 1 (right)
|
||||
function set(value) {
|
||||
function set(rawValue) {
|
||||
const value = Number(rawValue);
|
||||
leftGain.gain.value = value > 0 ? 1 - value : 1;
|
||||
rightGain.gain.value = value > 0 ? 1 : 1 + value;
|
||||
balance = value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue