Fix PFL channel custom outputs.
This commit is contained in:
parent
721fb632e2
commit
db7275bb12
1 changed files with 14 additions and 11 deletions
|
@ -188,19 +188,22 @@ class Player extends ((PlayerEmitter as unknown) as { new (): EventEmitter }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
_connectPFL() {
|
_connectPFL() {
|
||||||
if (this.pfl) {
|
// We check the existence of the analyser here, because if we're using a custom output, this won't exist.
|
||||||
// In this case, we just want to route the player output to the headphones direct.
|
if ((this.wavesurfer as any).backend.analyser) {
|
||||||
// Tap it from analyser to avoid the player volume.
|
if (this.pfl) {
|
||||||
(this.wavesurfer as any).backend.analyser.connect(
|
// In this case, we just want to route the player output to the headphones direct.
|
||||||
this.engine.headphonesNode
|
// Tap it from analyser to avoid the player volume.
|
||||||
);
|
(this.wavesurfer as any).backend.analyser.connect(
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
(this.wavesurfer as any).backend.analyser.disconnect(
|
|
||||||
this.engine.headphonesNode
|
this.engine.headphonesNode
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} else {
|
||||||
// This connection wasn't connected anyway, ignore.
|
try {
|
||||||
|
(this.wavesurfer as any).backend.analyser.disconnect(
|
||||||
|
this.engine.headphonesNode
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
// This connection wasn't connected anyway, ignore.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue