mapbox-navigation-android icon indicating copy to clipboard operation
mapbox-navigation-android copied to clipboard

Android Drop-In UI: Is it possible to play voice instruction of incident when we are nearby the incident?

Open Sridhar261990 opened this issue 2 years ago • 11 comments

Hello Team, I am using DropInUi for my application. I want to play the voice instruction when the driver is nearing the incident. I am getting incident information from the upcomingIncident.roadObject. Can I play the incident description by using the voice instructions?

implementation 'com.mapbox.navigation:ui-app:2.8.0-rc.2' implementation 'com.mapbox.navigation:ui-dropin:2.8.0-rc.2'

Sridhar261990 avatar Sep 20 '22 06:09 Sridhar261990

Hey @Sridhar261990 thanks for reaching out and report your question.

Yeah, you can play custom voice instructions. You can find an example on how to implement it in MapboxVoiceActivity from the examples test app 👀

https://github.com/mapbox/mapbox-navigation-android/blob/c862ce68aa0f06ccf79e6a7c72d433626d5593b3/examples/src/main/java/com/mapbox/navigation/examples/core/MapboxVoiceActivity.kt#L294-L299

Please take a look at it and let us know if you have any follow-up questions.

Thanks for checking out the SDK.

Guardiola31337 avatar Sep 20 '22 10:09 Guardiola31337

There might be an issue here. In MapboxVoiceActivity, the app instantiates VoiceInstructionPlayer and hence has access to it to be able to invoke voiceInstructionsPlayer.play()

private val voiceInstructionsPlayer: MapboxVoiceInstructionsPlayer by lazy {
        val options = VoiceInstructionsPlayerOptions.Builder()
            .abandonFocusDelay(PLAYER_ABANDON_FOCUS_DELAY)
            .build()
        MapboxVoiceInstructionsPlayer(
            this,
            getMapboxAccessTokenFromResources(),
            Locale.US.toLanguageTag(),
            options
        )
    }

However, Drop-In UI doesn't exposes the voiceInstructionsPlayer. Hence users using Drop-In UI won't be able to play additional instructions. Therefore we would need to expose an API that would expose voiceInstructionsPlayer created via Drop-In UI. Can you confirm if my understanding is correct @Guardiola31337

abhishek1508 avatar Sep 20 '22 10:09 abhishek1508

@Guardiola31337 Thanks for the input Pablo, your opinions are always valued, you've helped us a lot over the years.

@abhishek1508 This would be a "nice to have feature" but its far from blocking any releases on our end. My main concern is that the incident data I'm seeing in Canada isn't exactly short descriptions... I'm leary of having a driver try and read that qty of text while driving.... hence the feature request for audio.

Here are some of the shorter examples i've personally run into... both times I have travelling on roads with posted speed limits of 100 km/h, so I waited until I was stopped before looking ahead on the map to read incident text. not sure i want drivers to be reading this text while in motion at those speeds... image

EricGeiler avatar Sep 20 '22 13:09 EricGeiler

@EricGeiler Thanks for the detailed explanation. We will evaluate this request and come up with updates when we have a solution ready.

abhishek1508 avatar Sep 22 '22 03:09 abhishek1508

@EricGeiler Thanks for the detailed explanation. We will evaluate this request and come up with updates when we have a solution ready.

Thank you for the update! Hopefully its a useful suggestion!

EricGeiler avatar Sep 22 '22 11:09 EricGeiler

Hi @abhishek1508, May I know the status of this feature request?

Sridhar261990 avatar Oct 05 '22 10:10 Sridhar261990

@abhishek1508 This would be a "nice to have feature" but its far from blocking any releases on our end.

@Sridhar261990 Can you share the priority of this issue? I was under the impression that it is not launch blocking and hence we haven't picked it up yet. However, needless to say this is still something we are tracking and is under our radar.

abhishek1508 avatar Oct 05 '22 14:10 abhishek1508

@abhishek1508 It is not blocking. I am just curious to know when this feature will be available.

Sridhar261990 avatar Oct 05 '22 14:10 Sridhar261990

@abhishek1508 its a nice to have feature I'd like to include in our follow up release to drivers, its NOT blocking our initial release.

EricGeiler avatar Oct 05 '22 14:10 EricGeiler

@EricGeiler Thanks for clarifying. Can you share an estimated date for the follow up release? We will update the ticket once we have a working solution.

abhishek1508 avatar Oct 05 '22 14:10 abhishek1508

Lets call it Oct 20-31th time frame as a ball park.
Getting a 2.8.0-release from @Sridhar261990 today, gonna run with that fleet wide for a couple of weeks, then attempt a move to 2.9.0+ unless something requires a more prompt update to 2.9.0+

EricGeiler avatar Oct 05 '22 15:10 EricGeiler

This has been addressed https://github.com/mapbox/mapbox-navigation-android/pull/6475 and was released as a part of v2.9.0-beta.3

cc @EricGeiler @Sridhar261990

abhishek1508 avatar Oct 21 '22 17:10 abhishek1508

Closing as this issue has been resolved and feature delivered.

abhishek1508 avatar Nov 08 '22 22:11 abhishek1508