c# speech to text

using Google.API.Translate;
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;
using System.Speech.Synthesis;
using System.Speech.AudioFormat;
using System.Collections;
namespace SpeechToText
{
    public partial class prototype : Form
    {
        public prototype()
        {
            InitializeComponent();
        }
        //ArrayList liste = new ArrayList();
        //private void PopulateInstalledVoices()
        //{
        //    foreach (InstalledVoice voice in reader.GetInstalledVoices())
        //    {
        //        VoiceInfo info = voice.VoiceInfo;
        //        liste.Add(info.Name);
        //    }
        //}
        SpeechSynthesizer reader = new SpeechSynthesizer();
        private void btnSpeech_Click(object sender, EventArgs e)
        {
            if (txtSpeechText.Text.Trim().Length > 0)
            {
                reader.SpeakAsync(txtSpeechText.Text);
            }
            else
            {
                MessageBox.Show(“İlk Önce Okunması Gereken Yazıyı Giriniz !!”,”Uyarı”,MessageBoxButtons.OK,MessageBoxIcon.Warning);
                return;
            }
            /*
            Pause
            reader.Pause();
            Resume
            reader.Resume();
            */
        }
        private void prototype_Load(object sender, EventArgs e)
        {
            //PopulateInstalledVoices();
            this.ActiveControl = txtSpeechText;
            txtSpeechText.SelectAll();
            reader.SelectVoice(“IVONA 2 Filiz”);
        }
    }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: