Is there an existing issue for this?
Use case
When building navigation apps with custom voice announcements (e.g., toll section warnings, speed alerts), there's no way to coordinate timing with the SDK's built-in voice guidance. This causes overlapping speech where neither message is audible, resulting in a poor user experience.
Currently, we can only estimate when the SDK might be speaking based on NavInfo.distanceToNextStepMeters, but this is unreliable since:
- Announcement timing varies by maneuver type and road conditions
- Traffic alerts and rerouting announcements are unpredictable
- Different languages have different speech durations
Proposal
Add event callbacks to notify when voice guidance speech starts and completes:
// Option A: Dedicated listener
GoogleMapsNavigator.setVoiceGuidanceListener((VoiceGuidanceEvent event) {
switch (event) {
case VoiceGuidanceStarted(instruction: final text):
// SDK started speaking - pause custom TTS queue
case VoiceGuidanceCompleted():
// SDK finished speaking - resume custom TTS queue
}
});
// Option B: Property on NavigationAudioGuidanceSettings
GoogleMapsNavigator.setAudioGuidance(
NavigationAudioGuidanceSettings(
guidanceType: NavigationAudioGuidanceType.alertsAndGuidance,
onSpeechStart: (String instruction) => ...,
onSpeechComplete: () => ...,
),
);
Is there an existing issue for this?
Use case
When building navigation apps with custom voice announcements (e.g., toll section warnings, speed alerts), there's no way to coordinate timing with the SDK's built-in voice guidance. This causes overlapping speech where neither message is audible, resulting in a poor user experience.
Currently, we can only estimate when the SDK might be speaking based on
NavInfo.distanceToNextStepMeters, but this is unreliable since:Proposal
Add event callbacks to notify when voice guidance speech starts and completes: