Skip to content

Simple windows form application that speaks whatever user enters into given textbox.

Notifications You must be signed in to change notification settings

harshildarji/SpeakIt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

SpeakIt

Simple windows form application that speaks whatever user enters into given textbox.

Code behind:

  • Basic idea behind this is similar to my previous repository: KeySound

  • I included a textbox, groupbox with two radio buttons and a button.

  • User enters data/message into textbox provided, which then will be passed to a string variable as:

string text = textBox1.Text;
  • Now, We will create object of SpeechSynthesizer as:
SpeechSynthesizer speech = new SpeechSynthesizer();
  • Now, When user clicks on Speak button, we will call selectGender() function to select the gender of output voice based on option selected by the user.
  • This selectGender() is as follows:
public void selectGender()
{
    if (radioButton1.Checked == true)
        speech.SelectVoiceByHints(VoiceGender.Male, VoiceAge.Adult);
    else
        speech.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult);
}
  • Now, We will set speech volume as:
speech.Volume = 100;
  • At the end, We will call Speak method using object of SpeechSynthesizer with text as argument:
speech.Speak(text);
Thank you for visit.

About

Simple windows form application that speaks whatever user enters into given textbox.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages