VolumeBooster: Fix playing sound in wrong output device (#2840)
This commit is contained in:
parent
7f784befc2
commit
d10e649b63
|
@ -39,7 +39,7 @@ interface StreamData {
|
||||||
gainNode?: GainNode,
|
gainNode?: GainNode,
|
||||||
id: string,
|
id: string,
|
||||||
levelNode: AudioWorkletNode,
|
levelNode: AudioWorkletNode,
|
||||||
sinkId: string,
|
sinkId: string | "default",
|
||||||
stream: MediaStream,
|
stream: MediaStream,
|
||||||
streamSourceNode?: MediaStreamAudioSourceNode,
|
streamSourceNode?: MediaStreamAudioSourceNode,
|
||||||
videoStreamId: string,
|
videoStreamId: string,
|
||||||
|
@ -128,6 +128,12 @@ export default definePlugin({
|
||||||
gain.connect(data.audioContext.destination);
|
gain.connect(data.audioContext.destination);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
|
if (data.sinkId != null && data.sinkId !== data.audioContext.sinkId && "setSinkId" in AudioContext.prototype) {
|
||||||
|
// @ts-expect-error https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/setSinkId
|
||||||
|
data.audioContext.setSinkId(data.sinkId);
|
||||||
|
}
|
||||||
|
|
||||||
data.gainNode.gain.value = data._mute
|
data.gainNode.gain.value = data._mute
|
||||||
? 0
|
? 0
|
||||||
: data._volume / 100;
|
: data._volume / 100;
|
||||||
|
|
Loading…
Reference in a new issue