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,
|
||||
id: string,
|
||||
levelNode: AudioWorkletNode,
|
||||
sinkId: string,
|
||||
sinkId: string | "default",
|
||||
stream: MediaStream,
|
||||
streamSourceNode?: MediaStreamAudioSourceNode,
|
||||
videoStreamId: string,
|
||||
|
@ -128,6 +128,12 @@ export default definePlugin({
|
|||
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
|
||||
? 0
|
||||
: data._volume / 100;
|
||||
|
|
Loading…
Reference in a new issue