Skip to content

Commit c7d91e7

Browse files
mapbox-github-ci-writer-5[bot]kried
authored andcommitted
[Backport release/v0.24] Fix a hang in MapboxSpeechSynthesizer (#13482)
Backport of #13435 to `release/v0.24`. Cherry-picked commits: 6f983161b3c456ccfcd22c41e815b845e0205c25 Co-authored-by: Nastassia Makaranka <nastassia.makaranka@mapbox.com> GitOrigin-RevId: 19dc88628acfb812a79eaf9a6e244a9dee26375a
1 parent 4bffaa0 commit c7d91e7

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
# Changes to the Mapbox Navigation SDK for iOS
22

3+
## 3.24.0
4+
5+
### Audio
6+
7+
* Fixed a possible hang during `MapboxSpeechSynthesizer` initialization.
8+
39
## 3.24.0-rc.1
410

511
### Packaging
612

713
* MapboxNavigationCore now requires [MapboxMaps v11.24.0-rc.1](https://github.com/mapbox/mapbox-maps-ios/releases/tag/v11.24.0-rc.1)
814
* MapboxNavigationCore now requires [MapboxNavigationNative v324.24.0-rc.1](https://github.com/mapbox/mapbox-navigation-native-ios/releases/tag/v324.24.0-rc.1)
915

16+
### Map
17+
18+
* Fixed an issue where panning on the Mapbox map logo or info button could set the navigation camera to the idle state.
19+
1020
### Routing
1121

1222
* Fixed a race condition that could lead to a crash in `FasterRouteController`.

Sources/MapboxNavigationCore/VoiceGuidance/RemoteSpeechSynthesizer/MapboxSpeechSynthesizer.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,17 @@ public final class MapboxSpeechSynthesizer: SpeechSynthesizing {
4949
private func subscribeToSystemVolume() {
5050
audioPlayerQueue.async { [weak audioPlayer] in
5151
guard let audioPlayer else { return }
52-
let systemVolume = AVAudioSession.sharedInstance().outputVolume
52+
let session = AVAudioSession.sharedInstance()
53+
let systemVolume = session.outputVolume
5354
audioPlayer.volume = systemVolume
54-
}
55-
volumeSubscribtion = AVAudioSession.sharedInstance().publisher(for: \.outputVolume).sink { [weak self] volume in
56-
self?.audioPlayerQueue.async { [weak audioPlayer = self?.audioPlayer] in
57-
audioPlayer?.volume = volume
55+
56+
let subscription = session.publisher(for: \.outputVolume)
57+
.receive(on: self.audioPlayerQueue)
58+
.sink { [weak audioPlayer] volume in
59+
audioPlayer?.volume = volume
60+
}
61+
onMainAsync { [weak self] in
62+
self?.volumeSubscribtion = subscription
5863
}
5964
}
6065
}

0 commit comments

Comments
 (0)