Skip to content

Crash if profile was created with a different language #15

@miffins

Description

@miffins

Found a bug - if you create a profile and some actions with the speech engine set to one language, then change to another, it'll throw a System.InvalidOperationException when you try to load that profile, around line 209 in Form1.cs (speechEngine.LoadGrammar(mygram);)

Can be fixed by adding this line slightly above (line 302ish?) when creating the grammar builder:

GrammarBuilder builder = new GrammarBuilder();
builder.Culture = speechEngine.RecognizerInfo.Culture; //required if the profile was created in a different language to the one currently selected
builder.Append(myWordChoices);
Grammar mygram = new Grammar(builder);

Found it when I started it up in US English then realised I'm British.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions