File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -203,9 +203,10 @@ public class AudioManager: Loggable {
203
203
// trigger events when state mutates
204
204
_state. onDidMutate = { [ weak self] newState, oldState in
205
205
guard let self else { return }
206
+ // Return if state is equal.
207
+ guard newState != oldState else { return }
206
208
207
209
self . log ( " \( oldState) -> \( newState) " )
208
-
209
210
#if os(iOS)
210
211
let configureFunc = newState. customConfigureFunc ?? self . defaultConfigureAudioSessionFunc
211
212
configureFunc ( newState, oldState)
Original file line number Diff line number Diff line change @@ -351,16 +351,16 @@ extension Track {
351
351
func _mute( ) async throws {
352
352
// LocalTrack only, already muted
353
353
guard self is LocalTrack , !isMuted else { return }
354
- try await disable ( )
355
- try await stop ( )
354
+ try await disable ( ) // Disable track first
355
+ try await stop ( ) // Stop track
356
356
set ( muted: true , shouldSendSignal: true )
357
357
}
358
358
359
359
func _unmute( ) async throws {
360
360
// LocalTrack only, already un-muted
361
361
guard self is LocalTrack , isMuted else { return }
362
- try await enable ( )
363
- try await start ( )
362
+ try await start ( ) // Start track first (Configure session first if local audio )
363
+ try await enable ( ) // Enable track
364
364
set ( muted: false , shouldSendSignal: true )
365
365
}
366
366
}
You can’t perform that action at this time.
0 commit comments