Skip to content

Spoken instructions should automatically match the route response’s locale #933

Closed

Description

@1ec5

PollyVoiceController and RouteVoiceController both use Locale.preferredLocalLanguageCountryCode to choose the speech synthesis voice. This is usually correct, but if the developer has customized the route response’s locale by setting RouteOptions.locale, then instructions written in one language could potentially be read aloud in a different language, probably to humorous effect. Instead, the voice controllers should get their locales from RouteOptions.locale, which will help to ensure a matching language.

utterance?.voice = AVSpeechSynthesisVoice(language: Locale.preferredLocalLanguageCountryCode)

let langs = Locale.preferredLocalLanguageCountryCode.components(separatedBy: "-")

/cc @bsudekum @ericrwolfe

Activity

  1. 1ec5 commented on Dec 16, 2017

    @1ec5
    ContributorAuthor

    #617 is replacing PollyVoiceController with MapboxVoiceController, which will correctly match the route response’s locale.

  2. bsudekum commented on Dec 19, 2017

    @bsudekum
    Contributor

    @1ec5 is it worth fixing this while we work on #617?

  3. 1ec5 commented on Dec 20, 2017

    @1ec5
    ContributorAuthor

    Yes, #617 can address the Polly side of the bug, but the fix needs to be general enough to also address the AVFoundation fallback.

  4. bsudekum commented on Jan 22, 2018

    @bsudekum
    Contributor

    Done in 1a161fd

  5. bsudekum commented on Feb 16, 2018

    @bsudekum
    Contributor

    This is was added in #617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtopic: localizationtopic: voice

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions