Skip to content

Commit 1c303fb

Browse files
committed
add Panner.getPan to safari fallback
1 parent 726cbdc commit 1c303fb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/panner.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ if (typeof ac.createStereoPanner !== 'undefined') {
5656
this.input = ac.createGain();
5757
input.connect(this.input);
5858

59+
this.panValue = 0;
5960
this.left = ac.createGain();
6061
this.right = ac.createGain();
6162
this.left.channelInterpretation = 'discrete';
@@ -81,6 +82,7 @@ if (typeof ac.createStereoPanner !== 'undefined') {
8182

8283
// -1 is left, +1 is right
8384
pan(val, tFromNow) {
85+
this.panValue = val;
8486
var time = tFromNow || 0;
8587
var t = ac.currentTime + time;
8688
var v = (val + 1) / 2;
@@ -90,6 +92,10 @@ if (typeof ac.createStereoPanner !== 'undefined') {
9092
this.right.gain.linearRampToValueAtTime(rightVal, t);
9193
}
9294

95+
getPan() {
96+
return this.panValue;
97+
}
98+
9399
inputChannels(numChannels) {
94100
if (numChannels === 1) {
95101
this.input.disconnect();

0 commit comments

Comments
 (0)