mapbox / mapbox-navigation-ios

Turn-by-turn navigation logic and UI in Swift on iOS
https://docs.mapbox.com/ios/navigation/
Other
860 stars 310 forks source link

Allow clients of MapboxVoiceController to customize SpeechOptions #1649

Open 1ec5 opened 6 years ago

1ec5 commented 6 years ago

MapboxVoiceController sets the locale when fetching the audio for a spoken instruction, but the application may also want to set other options, namely the gender via SpeechOptions.speechGender. MapboxVoiceController should expose these options somehow, whether through individual properties, a speechOptions property set upfront, or a new delegate protocol.

https://github.com/mapbox/mapbox-navigation-ios/blob/ef7a5258172fec80db6125966df6708aeb7a5031/MapboxNavigation/MapboxVoiceController.swift#L155-L158

/cc @bsudekum @willwhite

billyking991 commented 5 years ago

I was just wondering if there was an update to adding gender to the SpeechOptions. I get emails from users and there are lots of nice people who have been asking for male voices. I have added the ability in my apps to use different English accents (UK, US, India, and Australian), but I would love to also be able to be able to also select the gender. Most of the Polly voices have both Male and Female voice options. Do you know when I might have access to the male voices?

Thanks for all the work you all do. Your SDK has really come along nicely!!

billyking991 commented 4 years ago

I just hardcoded:

options.speechGender = . male

into the fetchAndSpeak method in MapboxVoiceController. Unfortunately, it still speaks in a female voice. I just wanted to see if a male voice was even possible before working out a subclass. Hoping both male and female genders are available in version 1.0.0. It would be a nice option to add and people have been asking for it.

1ec5 commented 3 years ago

Unfortunately, it still speaks in a female voice.

Can you try again? We did refactor the speech controllers in #2348, so it might have helped. Make sure to modify both SpeechOptions instances that get created: in MapboxSpeechSynthesizer.fetchAndSpeak(instruction:locale:) and MapboxSpeechSynthesizer.downloadAndCacheSpokenInstruction(instruction:locale:).

1ec5 commented 2 years ago

@Udumft, is this fixed by #3747?

Udumft commented 2 years ago

3747 provides a way to use custom SpeechSynthesizer which allows modifying the options used to generate the voice. So yes, I would say that it resolves the ticket.