Skip to content

Commit

Permalink
Localition/Grammar mismatch fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Baykov committed Dec 18, 2014
1 parent 83264f4 commit d5b5ed7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
11 changes: 6 additions & 5 deletions GAVPI/GAVPI/VI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace GAVPI
{
public class VI
{

SpeechSynthesizer vi_syn;
SpeechRecognitionEngine vi_sre;
ListView statusContainer; // listview in main form
Expand All @@ -29,10 +28,10 @@ public class VI

public VI()
{
pushtotalk_active = false;
pushtotalk_keyIsDown = false;
pushtotalk_active = false;
pushtotalk_keyIsDown = false;
pushtotalk_keyDownHook = new KeyboardHook.KeyDownEventHandler(KeyboardHook_KeyDown);
pushtotalk_keyUpHook = new KeyboardHook.KeyUpEventHandler(KeyboardHook_KeyUp);
pushtotalk_keyUpHook = new KeyboardHook.KeyUpEventHandler(KeyboardHook_KeyUp);
}

//
Expand All @@ -55,6 +54,9 @@ public bool load_listen( ListView statusContainer )
vi_sre = new SpeechRecognitionEngine( GAVPI.vi_settings.recognizer_info );

GrammarBuilder phrases_grammar = new GrammarBuilder();
// Grammer must match speech recognition language localization
phrases_grammar.Culture = GAVPI.vi_settings.recognizer_info;

List<string> glossory = new List<string>();

foreach (VI_Phrase trigger in GAVPI.vi_profile.Profile_Triggers)
Expand Down Expand Up @@ -98,7 +100,6 @@ public bool load_listen( ListView statusContainer )

// TODO:
// Push-to-Talk keyboard hook. Unimplemented.

try {

KeyboardHook.KeyDown += pushtotalk_keyDownHook;
Expand Down
6 changes: 4 additions & 2 deletions GAVPI/GAVPI/VI_Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class VI_Settings

public System.Globalization.CultureInfo recognizer_info;
public string voice_info;

public string pushtotalk_mode;
public string pushtotalk_key;

Expand All @@ -24,21 +25,22 @@ public VI_Settings()
SpeechSynthesizer synthesizer = new SpeechSynthesizer();
voice_info = new SpeechSynthesizer().GetInstalledVoices()[0].VoiceInfo.Name;
pushtotalk_mode = "Off" ;
pushtotalk_key = "Scroll" ;
pushtotalk_key = "Scroll" ;
}
public void load_settings(string filename)
{
// TODO

}
public void save_settings()
{
// TODO
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
XmlWriter writer = XmlWriter.Create("settings.xml", settings);
writer.WriteStartDocument();
writer.WriteStartElement("gavpi");


writer.WriteEndElement();
writer.WriteEndDocument();
writer.Flush();
Expand Down
3 changes: 1 addition & 2 deletions GAVPI/GAVPI/frmGAVPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ namespace GAVPI
{
public partial class frmGAVPI : Form
{
string BUILD_VERSION = "GAVPI Alpha Build 0.03 08.10.14";

string BUILD_VERSION = "GAVPI Alpha Build 0.04 12.18.14";

public frmGAVPI()
{
Expand Down

0 comments on commit d5b5ed7

Please sign in to comment.