Ejemplo n.º 1
0
 private void button_Click(object sender, RoutedEventArgs e)
 {
     button.IsEnabled = false;
     //foreach (var wav in CreateWav)
     //{
     //    string c1 = "server_url=dev.voicecloud.cn,appid=4e7bf06d,timeout=10000";
     //    string c2 = "sub=iat,ssm=1,auf=audio/L16;rate=16000,aue=speex,ent=sms16k,rst=plain";
     //    iFlyISR isr = new iFlyISR(c1, c2);
     //    //using(iFlyISR isr = new iFlyISR(c1, c2))
     //    //{
     //    //    isr.DataArrived += new EventHandler<iFlyISR.DataArrivedEventArgs>(asr_DataAvailable);
     //    //    isr.ISREnd += new EventHandler(Isr_ISREnd);
     //    //    isr.Audio2TxtAsync(wav, null);
     //    //}
     //    isr.DataArrived += new EventHandler<iFlyISR.DataArrivedEventArgs>(asr_DataAvailable);
     //    isr.ISREnd += new EventHandler(Isr_ISREnd);
     //    isr.Audio2TxtAsync("wav", null);
     //    isr.DataArrived -= new EventHandler<iFlyISR.DataArrivedEventArgs>(asr_DataAvailable);
     //    isr.ISREnd -= new EventHandler(Isr_ISREnd);
     //}
     string c1 = "server_url=dev.voicecloud.cn,appid=51fc7487,timeout=10000";
     string c2 = "sub=iat,ssm=1,auf=audio/L16;rate=16000,aue=speex,ent=sms16k,rst=plain";
     iFlyISR isr = new iFlyISR(c1, c2);
     isr.DataArrived += new EventHandler<iFlyISR.DataArrivedEventArgs>(asr_DataAvailable);
     isr.ISREnd += new EventHandler(Isr_ISREnd);
     isr.Audio2TxtAsync(OutputFileName, null);
 }
Ejemplo n.º 2
0
 public void TransSpeech(string speech)
 {
     button.IsEnabled = false;
     string c1 = "server_url=dev.voicecloud.cn,appid=51fc7487,timeout=10000";
     string c2 = "sub=iat,ssm=1,auf=audio/L16;rate=16000,aue=speex,ent=sms16k,rst=plain";
     iFlyISR isr = new iFlyISR(c1, c2);
     isr.DataArrived += new EventHandler<iFlyISR.DataArrivedEventArgs>(asr_DataAvailable);
     isr.ISREnd += new EventHandler(Isr_ISREnd);
     isr.Audio2TxtAsync(speech, null);
 }