static void Main(string[] args) { var configurationFilename = (args.Length > 0) ? args[0] : DefaultConfigurationFilename; var configuration = SoundboardBotConfiguration.FromFile(configurationFilename); var bot = new SoundboardBot(configuration); Console.Title = configuration.Name; bot.Connect(); }
public SoundboardSpeechRecognizer(SoundboardBot bot) { this.Stream = new SoundboardAudioStream( Convert.ToInt32((48000 * 2) * (60.0 / 1000.0))); // 60ms per audio frame this.Bot = bot; this.format = new SpeechAudioFormatInfo(48000, AudioBitsPerSample.Sixteen, AudioChannel.Mono); this.speech = new SpeechRecognitionEngine(); this.speech.SetInputToAudioStream(Stream, format); this.speech.SpeechRecognized += OnSpeechRecognized; this.BuildGrammar(); this.Start(); }