No voice in 0.13
Since 0.13 I am not getting any voice instructions. I get my routes via an external server which gets the DirectionRoute from Mapbox. Then I process the json to create a DirectionRoute via the Builder. When using the builder I set the RouteOptions.language:
RouteOptions routeOptions = RouteOptions.builder()
.language("en")
And the DirectionRoute.voiceLanguage
directionsRoute = DirectionsRoute.builder()
.voiceLanguage("en") //since 0.13
I start the navigation this way:
navigationOptions = MapboxNavigationOptions.builder()
.locale(Locale.forLanguageTag("en"))
NavigationViewOptions options = NavigationViewOptions.builder()
.navigationOptions(navigationOptions)
.directionsRoute(route)
navigationView.startNavigation(options);
I also tried different combinations of .language, .voiceLanguage and .locale. Also not setting them, but with no result.
There are no logs or errors describing what is happening.
Android API: 27 (OnePlus 5) and 24 (Samsung J5) Mapbox Navigation SDK version: 0.13
Expected behavior
I expected that the navigationView would give me voice instruction without the need to change anything in code when transferring from 0.12 to 0.13
Actual behavior
No voice instructions
Hi @chooble , were you using an awsPoolId previously? And are you using NavigationView or a custom view implementation?
Hi @devotaaabel! No I wasn't using awsPoolId previously and I'm using the default NavigationView.
@chooble Can you add a MilestoneEventListener via NavigationViewOptions#milestoneEventListener?
After adding this, can you verify that VoiceInstructionMilestone is being sent via this callback as you travel along the route? Thanks, this will help us determine the source of the bug you're seeing.
I am also not getting voice in 0.13, and, like @chooble, am constructing my own DirectionsRoute based on a response from our own OSRM route server. It worked fine earlier and still works well except for the voice.
I've got nothing else to add at this point and have been drawn off to another urgent project for a few days -- I can spend some time troubleshooting with you early next week if it's still a mystery.
@tonyc10 Do you mind trying the same suggestion https://github.com/mapbox/mapbox-navigation-android/issues/922#issuecomment-389556517? Voice instructions are provided by the response from the directions API, so I think something may be going on with that.
@danesfeder Hi! I added the MilestoneEventListener and getting this output (instruction is in dutch):
I'm logging this:
@Override
public void onMilestoneEvent(RouteProgress routeProgress, String instruction, Milestone milestone) {
Log.d("NavigationActivity", "\n");
Log.d("NavigationActivity", "onMilestoneEvent, instruction:" + instruction);
if(milestone.getInstruction()!=null) Log.d("NavigationActivity", "onMilestoneEvent, milestone.getInstruction:" + milestone.getInstruction().toString());
Log.d("NavigationActivity", "onMilestoneEvent, milestone.getIdentifier:" + milestone.getIdentifier());
if(progress!=null) Log.d("NavigationActivity", "onMilestoneEvent, milestone.isOccurring:" + milestone.isOccurring(progress, routeProgress));
Log.d("NavigationActivity", "\n");
progress = routeProgress;
}
And the output is:
05-16 18:01:21.404 2578-2578/ D/NavigationActivity:
onMilestoneEvent, instruction:Over 700 meter, ga rechtsaf naar Universiteitsweg (N412)
onMilestoneEvent, milestone.getInstruction:com.mapbox.services.android.navigation.v5.milestone.VoiceInstructionMilestone$1@3031b59
onMilestoneEvent, milestone.getIdentifier:1
onMilestoneEvent, milestone.isOccurring:false
05-16 18:01:39.384 2578-2578/ D/NavigationActivity:
onMilestoneEvent, instruction:Ga rechtsaf naar Universiteitsweg (N412)
onMilestoneEvent, milestone.getInstruction:com.mapbox.services.android.navigation.v5.milestone.VoiceInstructionMilestone$1@232e733
onMilestoneEvent, milestone.getIdentifier:1
onMilestoneEvent, milestone.isOccurring:false
05-16 18:01:39.389 2578-2578/ D/NavigationActivity:
onMilestoneEvent, instruction:
onMilestoneEvent, milestone.getIdentifier:2
onMilestoneEvent, milestone.isOccurring:false
05-16 18:01:47.405 2578-2578/ D/NavigationActivity:
onMilestoneEvent, instruction:Neem Utrechtseweg (N237) in oostelijke richting, daarna links aanhouden op de splitsing naar Utrechtseweg (N237)
onMilestoneEvent, milestone.getInstruction:com.mapbox.services.android.navigation.v5.milestone.VoiceInstructionMilestone$1@3d58648
onMilestoneEvent, milestone.getIdentifier:1
onMilestoneEvent, milestone.isOccurring:false
05-16 18:01:47.408 2578-2578/ D/NavigationActivity:
onMilestoneEvent, instruction:
onMilestoneEvent, milestone.getIdentifier:2
onMilestoneEvent, milestone.isOccurring:false
05-16 18:02:16.384 2578-2578/ D/NavigationActivity:
onMilestoneEvent, instruction:Links aanhouden op de splitsing naar Utrechtseweg (N237), daarna ga linksaf naar Utrechtseweg (N225)
onMilestoneEvent, milestone.getInstruction:com.mapbox.services.android.navigation.v5.milestone.VoiceInstructionMilestone$1@e7dbb29
onMilestoneEvent, milestone.getIdentifier:1
onMilestoneEvent, milestone.isOccurring:false
05-16 18:02:16.387 2578-2578/ D/NavigationActivity:
onMilestoneEvent, instruction:
onMilestoneEvent, milestone.getIdentifier:2
onMilestoneEvent, milestone.isOccurring:false
05-16 18:02:24.376 2578-2578/ D/NavigationActivity:
onMilestoneEvent, instruction:
onMilestoneEvent, milestone.getIdentifier:2
onMilestoneEvent, milestone.isOccurring:false
I used @chooble's logging code and looks like my results are the same:
Turn right onto East 36th Street
onMilestoneEvent, milestone.getInstruction:com.mapbox.services.android.navigation.v5.milestone.VoiceInstructionMilestone$1@b08c6dc
onMilestoneEvent, milestone.getIdentifier:1
onMilestoneEvent, instruction:
onMilestoneEvent, milestone.getIdentifier:2
onMilestoneEvent, milestone.isOccurring:false
onMilestoneEvent, instruction:Turn left onto 46th Avenue South
onMilestoneEvent, milestone.getInstruction:com.mapbox.services.android.navigation.v5.milestone.VoiceInstructionMilestone$1@d731fdd
onMilestoneEvent, milestone.getIdentifier:1
onMilestoneEvent, milestone.isOccurring:false
onMilestoneEvent, instruction:
onMilestoneEvent, milestone.getIdentifier:2
onMilestoneEvent, milestone.isOccurring:false
onMilestoneEvent, instruction:Turn left onto East 46th Street (CR 46)
onMilestoneEvent, milestone.getInstruction:com.mapbox.services.android.navigation.v5.milestone.VoiceInstructionMilestone$1@590a6eb
onMilestoneEvent, milestone.getIdentifier:1
onMilestoneEvent, milestone.isOccurring:false
onMilestoneEvent, instruction:
onMilestoneEvent, milestone.getIdentifier:2
onMilestoneEvent, milestone.isOccurring:false
onMilestoneEvent, instruction:Continue onto Ford Parkway (CR 42)
onMilestoneEvent, milestone.getInstruction:com.mapbox.services.android.navigation.v5.milestone.VoiceInstructionMilestone$1@b8de496
onMilestoneEvent, milestone.getIdentifier:1
onMilestoneEvent, milestone.isOccurring:false
onMilestoneEvent, instruction:
onMilestoneEvent, milestone.getIdentifier:2
onMilestoneEvent, milestone.isOccurring:false
onMilestoneEvent, instruction:Turn right
onMilestoneEvent, milestone.getInstruction:com.mapbox.services.android.navigation.v5.milestone.VoiceInstructionMilestone$1@9dd0517
onMilestoneEvent, milestone.getIdentifier:1
onMilestoneEvent, milestone.isOccurring:false
@chooble @tonyc10 Okay great, thank you both. So this means valid voice instructions are being fired, but something may be happening with the speech player code on our side. We will look into this - thanks for the help.
Hey @chooble @tony-cj can you both test your issues again with our newest release of the SDK 0.14.0 - please note - there are API breaking changes: https://github.com/mapbox/mapbox-navigation-android/releases/tag/v0.14.0
I don't seem to get it working. I've set the .language and .voiceUnit in RouteOptions like you described in the release notes. Also the .voiceLanguage in de DirectionRoute builder.
@danesfeder i think the error could be related to a missing error case during the download of the mapbox voice file: MapboxSpeechPlayer.java
If the response is not successful (if (response.isSuccessful())) there is no error callback.
No luck for me either. I put in 0.14.0, fixed the breaking API changes, and ran it — still no voice. I also played around with the RouteOptions like Tristan.
I construct my DirectionsRoute from the JSON of our OSRM server, with a RouteOptions I build. All worked, including voice, prior to 0.13.0.
- Tony
On Fri, Jun 1, 2018 at 4:28 AM, Tristan [email protected] wrote:
I don't seem to get it working. I've set the .language and .voiceUnit in RouteOptions like you described in the release notes. Also the .voiceLanguage in de DirectionRoute builder.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mapbox/mapbox-navigation-android/issues/922#issuecomment-393826032, or mute the thread https://github.com/notifications/unsubscribe-auth/ADjrbeWxb2Ku48VbNUGK09oQX2cmg6z1ks5t4Qk0gaJpZM4T0ptS .
@skienzl I'll get that in the next release.
@devotaaabel @danesfeder , do you have an ETA for the solution? Did you already found cause of the problem?
@chooble we have still been unable to reproduce your error, but I did add an extra call to retry using native TTS if MapboxSpeech fails here: https://github.com/mapbox/mapbox-navigation-android/commit/01aefe0da32dbc081d7b69d33f2d9ee51a2f4a35. I also have a PR open right now to log errors to hopefully help you find your issue if the latter doesn't help: https://github.com/mapbox/mapbox-navigation-android/pull/1036. There will most likely be a release this week including both.
Hey @chooble 👋 0.15.0 was released including @devotaaabel's above-mentioned changes.
Could you retest your issues again with our newest release of the SDK 0.15.0?
cc @tonyc10 @skienzl
0.15.0 brings back the voice for my app! Hooray!!
To summarize my experience, 0.13.0, 0.14.0 = no voice; 0.15.0 = voice.
Thank you.
On Mon, Jun 25, 2018 at 7:41 AM, Pablo Guardiola [email protected] wrote:
Hey @chooble https://github.com/chooble 👋 0.15.0 was released including @devotaaabel https://github.com/devotaaabel's above-mentioned changes.
Could you retest your issues again with our newest release of the SDK 0.15.0 https://github.com/mapbox/mapbox-navigation-android/releases/tag/v0.15.0 ?
cc @tonyc10 https://github.com/tonyc10 @skienzl https://github.com/skienzl
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mapbox/mapbox-navigation-android/issues/922#issuecomment-399938102, or mute the thread https://github.com/notifications/unsubscribe-auth/ADjrbcMgjkL13N7x5f1VHMGs-_crRawpks5uANqVgaJpZM4T0ptS .
I do now get a crash when selecting the mute button (speaker icon) on the turn by turn display:
java.lang.NullPointerException: Attempt to invoke virtual method 'void
com.mapbox.services.android.navigation.ui.v5.voice.MapboxSpeechPlayer.setMuted(boolean)' on a null object reference at com.mapbox.services.android.navigation.ui.v5.voice.NavigationInstructionPlayer.setMuted(NavigationInstructionPlayer.java:50) at com.mapbox.services.android.navigation.ui.v5.NavigationViewModel.setMuted(NavigationViewModel.java:100) at com.mapbox.services.android.navigation.ui.v5.instruction.InstructionView$6.onClick(InstructionView.java:593) at android.view.View.performClick(View.java:5637) at android.view.View$PerformClick.run(View.java:22429) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6121) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
When voice wasn't working, selecting that button had no effect.
On Mon, Jun 25, 2018 at 10:21 AM, Tony Case [email protected] wrote:
0.15.0 brings back the voice for my app! Hooray!!
To summarize my experience, 0.13.0, 0.14.0 = no voice; 0.15.0 = voice.
Thank you.
On Mon, Jun 25, 2018 at 7:41 AM, Pablo Guardiola <[email protected]
wrote:
Hey @chooble https://github.com/chooble 👋 0.15.0 was released including @devotaaabel https://github.com/devotaaabel's above-mentioned changes.
Could you retest your issues again with our newest release of the SDK 0.15.0 https://github.com/mapbox/mapbox-navigation-android/releases/tag/v0.15.0 ?
cc @tonyc10 https://github.com/tonyc10 @skienzl https://github.com/skienzl
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mapbox/mapbox-navigation-android/issues/922#issuecomment-399938102, or mute the thread https://github.com/notifications/unsubscribe-auth/ADjrbcMgjkL13N7x5f1VHMGs-_crRawpks5uANqVgaJpZM4T0ptS .
@Guardiola31337 Great! It's working now! 👍 🥇
@tonyc10 Unfortunately this is a known issue and is being addressed in https://github.com/mapbox/mapbox-navigation-android/pull/1054. Thanks for the feedback and glad to hear we are working towards a solution here.