Skip to content
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

Merged
merged 5 commits into from
Jul 29, 2020
Merged

Custom Voice Controller Example #67

merged 5 commits into from
Jul 29, 2020

Conversation

Udumft
Copy link
Contributor

@Udumft Udumft commented Jul 24, 2020

Updating Custom Voice Controller example to reflect latest API changes.

Also, this PR adds .netrc config for CircleCI pipeline to enable checking out dependencies.

@Udumft Udumft added the build label Jul 24, 2020
@Udumft Udumft requested review from 1ec5 and MaximAlien July 24, 2020 15:46
@Udumft Udumft self-assigned this Jul 24, 2020
@@ -3,16 +3,14 @@ import UIKit
import MapboxCoreNavigation
import MapboxNavigation
import MapboxDirections
import MapboxSpeech
Copy link
Contributor Author

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) {
Copy link
Contributor Author

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?

Copy link
Contributor

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.

Comment on lines 22 to 25
echo "machine dl.bintray.com" > ~/.netrc
echo "login $BINTRAY_LOGIN" >> ~/.netrc
echo "password $BINTRAY_API_KEY" >> ~/.netrc
echo >> ~/.netrc
Copy link
Contributor

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)
Copy link
Contributor

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) {
Copy link
Contributor

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.

@MaximAlien
Copy link
Contributor

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.

@1ec5
Copy link
Contributor

1ec5 commented Jul 27, 2020

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?

@MaximAlien
Copy link
Contributor

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.

@Udumft Udumft merged commit 6931062 into release-v1.0 Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants