Click here to Skip to main content
15,885,757 members
Home / Discussions / C#
   

C#

 
GeneralRe: ControlDesigner issue Pin
mo149231-Jul-22 6:43
mo149231-Jul-22 6:43 
Questionhow to save Image or Bitmap to svg file Pin
Le@rner29-Jul-22 1:51
Le@rner29-Jul-22 1:51 
AnswerRe: how to save Image or Bitmap to svg file Pin
OriginalGriff29-Jul-22 2:19
mveOriginalGriff29-Jul-22 2:19 
AnswerRe: how to save Image or Bitmap to svg file Pin
Gerry Schmitz29-Jul-22 8:38
mveGerry Schmitz29-Jul-22 8:38 
AnswerRe: how to save Image or Bitmap to svg file Pin
Calin Negru30-Jul-22 2:42
Calin Negru30-Jul-22 2:42 
QuestionCan you use sqlite in vs2022? CLOSED Pin
mo149228-Jul-22 13:18
mo149228-Jul-22 13:18 
AnswerRe: Can you use sqlite in vs2022? CLOSED Pin
OriginalGriff28-Jul-22 19:00
mveOriginalGriff28-Jul-22 19:00 
QuestionC# Set voice in Text to Speech Pin
Rockallica27-Jul-22 17:02
Rockallica27-Jul-22 17:02 
Hi,

How do I set the voice in Text to Speech in C#?

I have a toolStripMenu that I load the voices into. Then when one is chosen, I want it to use that voice. Haven't been able to figure set the voice to the chosen name.


Thanks.


C#
private void Get_Voices()
{
    ISpeechObjectTokens voices = objSpeech.GetVoices("", "");

    foreach (ISpeechObjectToken v in voices)
    {
              ts_Menu = new ToolStripMenuItem();

               v_name = v.GetDescription(0);
   
               ts_Menu.Text = v_name;

               ts_Menu.CheckOnClick = true;

               voicesToolStripMenu.DropDownItems.Add(ts_Menu);
               
                ts_Menu.Click += voice_Menu_Click;
     }
}
 
private void voice_Menu_Click(object sender, EventArgs e)
{
         ToolStripMenuItem item = sender as ToolStripMenuItem;
          foreach (ToolStripMenuItem tempItemp in voicesToolStripMenu.DropDownItems)
          {

             if (tempItemp == item)
             {
                   tempItemp.Checked = true;
              } 
               else
               {
                   tempItemp.Checked = false;
                } 
           }

           choosen_voice = sender.ToString();

}

private void Speak(string txt)
{
   
     SpVoice objSpeech = new SpVoice();

     objSpeech.Speak(txt, SpeechVoiceSpeakFlags.SVSFlagsAsync);
            
     objSpeech.WaitUntilDone(Timeout.Infinite);
        
}

AnswerRe: C# Set voice in Text to Speech Pin
OriginalGriff27-Jul-22 20:16
mveOriginalGriff27-Jul-22 20:16 
GeneralRe: C# Set voice in Text to Speech Pin
Rockallica28-Jul-22 8:39
Rockallica28-Jul-22 8:39 
GeneralRe: C# Set voice in Text to Speech Pin
OriginalGriff28-Jul-22 8:52
mveOriginalGriff28-Jul-22 8:52 
QuestionIn C# can't introduce a formula in Excel Pin
Ismael_199927-Jul-22 12:37
Ismael_199927-Jul-22 12:37 
AnswerRe: In C# can't introduce a formula in Excel Pin
trønderen27-Jul-22 12:55
trønderen27-Jul-22 12:55 
AnswerRe: In C# can't introduce a formula in Excel Pin
Gerry Schmitz27-Jul-22 14:47
mveGerry Schmitz27-Jul-22 14:47 
GeneralRe: In C# can't introduce a formula in Excel Pin
Ismael_199928-Jul-22 7:53
Ismael_199928-Jul-22 7:53 
QuestionI having this error could anyone can help me :Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at ValidParenthese.Solution.IsValid (System.String s) [0x00000] in <89120c6f256647e6a05011f274f6a Pin
swethamaddi26-Jul-22 23:20
swethamaddi26-Jul-22 23:20 
AnswerRe: I having this error could anyone can help me :Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at ValidParenthese.Solution.IsValid (System.String s) [0x00000] in <89120c6f256647e6a05011f27 Pin
Richard MacCutchan26-Jul-22 23:51
mveRichard MacCutchan26-Jul-22 23:51 
AnswerRe: I having this error could anyone can help me :Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at ValidParenthese.Solution.IsValid (System.String s) [0x00000] in <89120c6f256647e6a05011f27 Pin
Dave Kreskowiak27-Jul-22 6:57
mveDave Kreskowiak27-Jul-22 6:57 
QuestionWhat Is NullReferenceException? Object reference not set to an instance of an object i have error how to change code unable to excute below code could help me Pin
swethamaddi26-Jul-22 23:15
swethamaddi26-Jul-22 23:15 
AnswerRe: What Is NullReferenceException? Object reference not set to an instance of an object i have error how to change code unable to excute below code could help me Pin
Richard MacCutchan26-Jul-22 23:51
mveRichard MacCutchan26-Jul-22 23:51 
AnswerRe: What Is NullReferenceException? Object reference not set to an instance of an object i have error how to change code unable to excute below code could help me Pin
OriginalGriff27-Jul-22 0:04
mveOriginalGriff27-Jul-22 0:04 
AnswerRe: What Is NullReferenceException? Object reference not set to an instance of an object i have error how to change code unable to excute below code could help me Pin
Calin Negru28-Jul-22 0:11
Calin Negru28-Jul-22 0:11 
QuestionHow to convert pdf file into FileStream? Pin
Code4Ever26-Jul-22 6:35
Code4Ever26-Jul-22 6:35 
GeneralRe: How to convert pdf file into FileStream? Pin
Richard MacCutchan26-Jul-22 6:49
mveRichard MacCutchan26-Jul-22 6:49 
GeneralRe: How to convert pdf file into FileStream? Pin
Code4Ever26-Jul-22 6:59
Code4Ever26-Jul-22 6:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.