@@ -250,6 +250,9 @@ async function leaveRoom() {
250
250
await room . value ?. disconnect ( )
251
251
await mixer . value ?. playFileSource ( 'qall_end' )
252
252
253
+ await audioContext ?. value ?. close ( )
254
+ audioContext . value = undefined
255
+
253
256
// Empty all variables
254
257
room . value = undefined
255
258
tracksMap . value . clear ( )
@@ -313,7 +316,7 @@ const addMicTrack = async () => {
313
316
314
317
// Publish the processed stream
315
318
await room . value . localParticipant . publishTrack ( audioTrack , {
316
- audioPreset : AudioPresets . musicHighQualityStereo ,
319
+ audioPreset : AudioPresets . speech ,
317
320
forceStereo : true ,
318
321
red : false ,
319
322
dtx : false
@@ -341,10 +344,6 @@ const removeMicTrack = async () => {
341
344
for ( const [ trackSid , trackInfo ] of tracksMap . value ) {
342
345
if ( trackInfo . isRemote ) continue
343
346
if ( trackInfo . trackPublication ?. track ?. id === audioTrackId . value ) {
344
- if ( audioContext . value ) {
345
- await audioContext . value . close ( )
346
- audioContext . value = undefined
347
- }
348
347
await trackInfo . trackPublication ?. track ?. mute ( )
349
348
}
350
349
}
@@ -371,10 +370,6 @@ const toggleMicTrack = async () => {
371
370
for ( const [ trackSid , trackInfo ] of tracksMap . value ) {
372
371
if ( trackInfo . isRemote ) continue
373
372
if ( trackInfo . trackPublication ?. track ?. id === audioTrackId . value ) {
374
- if ( audioContext . value ) {
375
- await audioContext . value . close ( )
376
- audioContext . value = undefined
377
- }
378
373
await trackInfo . trackPublication ?. track ?. unmute ( )
379
374
}
380
375
}
0 commit comments