Skip to content

Commit

Permalink
AudioSession Category 변경시 audioSessionUpdate하는 로직 수정 (#1158)
Browse files Browse the repository at this point in the history
## Summary
- AudioSession Category 변경시 audioSessionUpdate하는 로직 수정
- [AudioCategory의 상태가 categoryChanged일경우 NewDeviceAvailable과 동일하게 동작하도록
적용](54f9e0b)
- 기존 categoryChanged의 경우 break로 아무동작도 하지않아 audioSession을 업데이트해주지 않는 문제
발생
           - 동일하게 처리할수 있도록 적용
- [categoryChange, routeConfigurationChanged일때 updateAudioSesion에서
focus요청하지 않도록
적용](b0247f3)
- 위 처리에서 playback, playAndRecord관련 처리를 하고 있으므로 해당 커밋에서 requestFocus삭제
  • Loading branch information
ParkJongSang authored May 7, 2024
1 parent 659975d commit 979ca10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NuguClientKit/Sources/Audio/AudioSessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private extension AudioSessionManager {
self?.delegate?.audioSessionRouteChanged(reason: .categoryChange)

if self?.isCarplayConnected() == true {
self?.updateAudioSession(requestingFocus: true)
self?.updateAudioSession()
}
default: break
}
Expand Down
4 changes: 1 addition & 3 deletions NuguClientKit/Sources/Client/NuguClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -770,12 +770,10 @@ extension NuguClient: AudioSessionManagerDelegate {
if previousRoute?.outputs.first?.portType == .carAudio {
speechRecognizerAggregator.startListeningWithTrigger()
}
case .newDeviceAvailable:
case .newDeviceAvailable, .categoryChange:
if audioSessionManager?.isCarplayConnected() == true {
speechRecognizerAggregator.stopListening()
}
case .categoryChange:
break
}
}

Expand Down

0 comments on commit 979ca10

Please sign in to comment.