public RecordedView(string rFilePath, int time) { recordFilePath = rFilePath; InitializeComponent(); this.buttonPlay.Clicked += PlayRecorded; this.buttonStop.Clicked += StopRecorded; this.buttonPause.Clicked += PauseRecorded; //this.buttonGetVoiceText.Clicked += getVoiceText; this.buttonGetVoiceText.Clicked += async(sender, e) => { entryRecognizedText.Text = "loading the result"; //Task<string> tresult = GetVoiceText_async(rFilePath); voiceRecog = DependencyService.Get <IVoiceRecognition>(); voiceRecog.RecognizeVoice(rFilePath, entryRecognizedText); //string recogText = await tresult; //entryRecognizedText.Text = recogText; }; //this.labelFileName.Text = rFilePath; this.labelRecordedTime.Text = time.ToMinSecondString(); player = DependencyService.Get <IPlayer>(); }
public void run(Canvas cv, IDrawables draw, IVoiceRecognition vr) { //must be run first Commands.setupCommandsList(); this.cv = cv; this.draw = (Drawables)draw; this.vr = (VoiceRegTest)vr; PushCommand("command"); vr.startListening(); vr.NewCommand += PushCommand; }
private void Canvas_Shown(object sender, EventArgs e) { draw = new Drawables(this); vr = new VoiceRegTest(); cont = new Controller(); cont.run(this, draw, vr); richTextBox1.Text = "Commands: \n \n"; vr.NewAudioInput += OnPictureBox1VisibleChanged; vr.NewInput += OntextBox1_TextChanged; cont.CommandListChanged += OnChangeRichTextBox1; draw.ListChanged += OnChangeRichTextBox1; draw.GraphicsCleared += UpdateDraw; // what happends when the Canvas is shown UpdateDraw(null, null); }