Skip to content

Commit a2a1367

Browse files
authored
Merge pull request #4503 from traPtitech/fix/micTrack
一回ミュートすると声が出なくなる不具合の解決
2 parents dc04496 + 259ab89 commit a2a1367

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/composables/qall/useLiveKitSDK.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ async function leaveRoom() {
250250
await room.value?.disconnect()
251251
await mixer.value?.playFileSource('qall_end')
252252

253+
await audioContext?.value?.close()
254+
audioContext.value = undefined
255+
253256
// Empty all variables
254257
room.value = undefined
255258
tracksMap.value.clear()
@@ -313,7 +316,7 @@ const addMicTrack = async () => {
313316

314317
// Publish the processed stream
315318
await room.value.localParticipant.publishTrack(audioTrack, {
316-
audioPreset: AudioPresets.musicHighQualityStereo,
319+
audioPreset: AudioPresets.speech,
317320
forceStereo: true,
318321
red: false,
319322
dtx: false
@@ -341,10 +344,6 @@ const removeMicTrack = async () => {
341344
for (const [trackSid, trackInfo] of tracksMap.value) {
342345
if (trackInfo.isRemote) continue
343346
if (trackInfo.trackPublication?.track?.id === audioTrackId.value) {
344-
if (audioContext.value) {
345-
await audioContext.value.close()
346-
audioContext.value = undefined
347-
}
348347
await trackInfo.trackPublication?.track?.mute()
349348
}
350349
}
@@ -371,10 +370,6 @@ const toggleMicTrack = async () => {
371370
for (const [trackSid, trackInfo] of tracksMap.value) {
372371
if (trackInfo.isRemote) continue
373372
if (trackInfo.trackPublication?.track?.id === audioTrackId.value) {
374-
if (audioContext.value) {
375-
await audioContext.value.close()
376-
audioContext.value = undefined
377-
}
378373
await trackInfo.trackPublication?.track?.unmute()
379374
}
380375
}

0 commit comments

Comments
 (0)