-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Voice Controller Example #67
Conversation
@@ -3,16 +3,14 @@ import UIKit | |||
import MapboxCoreNavigation | |||
import MapboxNavigation | |||
import MapboxDirections | |||
import MapboxSpeech |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to include this in order to be able to call SpeechSynthesizingDelegate
methods (needs access to SpeechOptions
constructor). This makes me wonders if this mechanism could be enhanced to avoid importing additional modules.
} | ||
|
||
// Method to play provided audio data with some edge cases handling | ||
func speak(instruction: SpokenInstruction, instructionData: Data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same method in MapboxSpeechSynthesizer
is iternal
. Having it public
would've make this example much shorter. Do you think it is safe to expose it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not have fair amount of experience of working with speech instructions, but seems that it should be fine to expose this method publicly. E.g. it should align well in case when user creates spokenInstruction
manually and then wants to speak
it whenever needed. On the other hand it's not obvious what is instructionData
and how to create/use it correctly.
.circleci/config.yml
Outdated
echo "machine dl.bintray.com" > ~/.netrc | ||
echo "login $BINTRAY_LOGIN" >> ~/.netrc | ||
echo "password $BINTRAY_API_KEY" >> ~/.netrc | ||
echo >> ~/.netrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the end I think there is no need in entry for dl.bintray.com
anymore because since nav. native version 14.1.5
and higher is distributed via SDK Registry.
let speechSynthesizer = MultiplexedSpeechSynthesizer([CustomVoiceController(), SystemSpeechSynthesizer()] as? [SpeechSynthesizing]) | ||
let routeController = RouteVoiceController(navigationService: navigationService, speechSynthesizer: speechSynthesizer) | ||
// Remember to pass our `Voice Controller` to `Navigation Options`! | ||
let navigationOptions = NavigationOptions(navigationService: navigationService, voiceController: routeController) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to rename routeController
to routeVoiceController
?
} | ||
|
||
// Method to play provided audio data with some edge cases handling | ||
func speak(instruction: SpokenInstruction, instructionData: Data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not have fair amount of experience of working with speech instructions, but seems that it should be fine to expose this method publicly. E.g. it should align well in case when user creates spokenInstruction
manually and then wants to speak
it whenever needed. On the other hand it's not obvious what is instructionData
and how to create/use it correctly.
Also is it expected that voice instructions do not work on iPads? I did some tests on iPhone simulator and spoken instructions work whereas on iPad I don't hear any voice updates. |
That would be unexpected. Does the iPad have the same language settings? Does location tracking and route following continue to work normally? |
Strangely I'm no longer able to reproduce this issue. In case if I notice it once again I'll create separate ticket for it. iPad configurations (locale, language etc) are similar to iPhone simulators. |
Updating Custom Voice Controller example to reflect latest API changes.
Also, this PR adds
.netrc
config for CircleCI pipeline to enable checking out dependencies.