İçeriğe geç
ShiftDelete.Net
Haber ara/ SDN'ye SorGiriş
Haber Akışı SDNTV İnceleme Forum Yapay Zeka Akıllı Telefon Elektrikli Otomobil Oyun ShiftDelete.Net Global Teknoloji Haberleri Mobil Otomobil Donanım Savunma Bilim Sosyal Medya İnternet Giyilebilir Teknoloji Rehber Ürünler Sinema Dizi Akıllı Ev Motosiklet Mikromobilite Kripto Para Sağlık Teknolojileri Son dakika Yazarlar
  1. Ana sayfa
  2. SDN Forum
  3. Yazılım
  4. Diğer Yazılım Konuları
Diğer Yazılım Konuları

Speech örneğinde sıkıntı var

ibrahim59121.07.20190 cevap974 görüntüleme
#1
System.InvalidOperationException' türünde bir yakalanamayan özel durum, System.Speech.dll öğesinde oluştu.

***************************************************************************************************************************************************************************
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Speech.Recognition;
using System.Speech.Synthesis;
using System.Media;
using System.Diagnostics;

namespace CervisTr
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}

private static SpeechSynthesizer synth = new SpeechSynthesizer();
private static SpeechRecognitionEngine engine = new SpeechRecognitionEngine();
private void Form2_Load(object sender, EventArgs e)
{

}

void SesCervis()
{

Choices chan = new Choices();

chan.Add(new string[] { "Hey" });

GrammarBuilder gra = new GrammarBuilder();
gra.Append(chan);
Grammar grammar = new Grammar(gra);

engine.LoadGrammarAsync(grammar);

engine.SetInputToDefaultAudioDevice();
engine.SpeechRecognized += sesalgı;

}

private void sesalgı(object sender, SpeechRecognizedEventArgs e)
{

// if(e.Result.Text == "Hey")
// {
// SoundPlayer bip = new SoundPlayer(@"C:/Users/ibrah/Desktop/sesler/bip.wav");
// bip.Play();
// webBrowser1.Document.GetElementById("gt-speech").InvokeMember("click");
// timer1.Start();
// }

switch (e.Result.Text)
{

case "Hey":
MessageBox.Show("merhaba");
break;
}

}

private void timer1_Tick(object sender, EventArgs e)
{
if (webBrowser1.Document.GetElementById("source").InnerText == "Google'ı aç")
{
ProcessStartInfo google = new ProcessStartInfo();
google.FileName = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe";
Process.Start(google);
timer1.Stop();
}
}

private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
engine.RecognizeAsync(RecognizeMode.Multiple);
}
}
}

**************************************************************************************************************************************

CervisTr.exe Information: 0 : SAPI does not implement phonetic alphabet selection.
System.InvalidOperationException üzerinde 'System.Speech.dll' türünde bir özel durum oluştu
'System.InvalidOperationException' türünde bir yakalanamayan özel durum, System.Speech.dll öğesinde oluştu
At least one grammar must be loaded before doing a recognition.

'CervisTr.exe' (CLR v4.0.30319: CervisTr.exe): 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PrivateAssemblies\Runtime\Microsoft.VisualStudio.Debugger.Runtime.dll' yüklendi. Sembollerin yüklemesi atlandı. Modül iyileştirildi ve hata ayıklayıcının 'Yalnızca Kendi Kodum' seçeneği etkin hale getirildi.
'[8412] CervisTr.exe' programı -1 (0xffffffff) koduyla çıktı.

lütfen yardım edin

Cevabını yaz

Cevap yazmak için giriş yap ya da üye ol. Eski forum kullanıcı adın ve parolanla girebilirsin.