Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Allow toggling voice navigation while navigation is active #32

Closed
otsaloma opened this issue Apr 4, 2018 · 5 comments
Closed

Allow toggling voice navigation while navigation is active #32

otsaloma opened this issue Apr 4, 2018 · 5 comments
Milestone

Comments

@otsaloma
Copy link
Owner

otsaloma commented Apr 4, 2018

i.e. get rid of the enabled below.

TextSwitch {
id: voiceNavigationSwitch
checked: app.conf.get("voice_navigation")
enabled: !app.navigationActive
text: app.tr("Voice navigation instructions")
onCheckedChanged: enabled && app.conf.set("voice_navigation", voiceNavigationSwitch.checked);
}

I just don't quite remember why this needed to locked – @rinigus: your code, do you remember? Given the pregeneration, turning it on might have a slight delay, but that should be no big deal, and turning it off would still serve previously generated audio, but we can add a simple check on the QML side to ignore those. Anything else?

@rinigus
Copy link
Contributor

rinigus commented Apr 5, 2018

@otsaloma - not from the top of my head. I will look tonight and see why was it. I can only speculate that its due to the lag in generation of sound files, but I'll have to check the details. Let me come back to you with it.

@rinigus
Copy link
Contributor

rinigus commented Apr 5, 2018

Looked into the code a bit. If we want to do it on-fly, we'll have to call map.initVoiceNavigation . Other than that, I don't see why it shouldn't work. As you pointed out, we have verbal instructions anyway and user should expect some small delay...

While reading through the source, I could see that rerouting messages are created at each call of _get_voice_uri. In reality, its cached and not regenerated, but we could still move them maybe into set_voice

@otsaloma
Copy link
Owner Author

otsaloma commented Apr 5, 2018

OK, I'll do this via a PR and ping you when done so you can look it over too.

@rinigus
Copy link
Contributor

rinigus commented Apr 5, 2018

Will be happy to.

@otsaloma otsaloma added this to the 0.93 milestone Apr 7, 2018
otsaloma added a commit that referenced this issue Jun 10, 2018
@otsaloma
Copy link
Owner Author

This looked straight-forward, so I skipped the PR. Anyway, you can look over those two commits. As far as I can tell there's just three things needed:

  1. Don't play sound if voice navigation off (added, first commit)

  2. Don't generate new WAVs if voice navigation off (already existed)

  3. Reinitialize the voice generator if toggled on while navigation is active (added, second commit)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants