Click here to Skip to main content
15,792,841 members
Home / Discussions / C#
   

C#

 
GeneralRe: ControlDesigner issue Pin
mo149231-Jul-22 7:43
mo149231-Jul-22 7:43 
Questionhow to save Image or Bitmap to svg file Pin
Le@rner29-Jul-22 2:51
Le@rner29-Jul-22 2:51 
AnswerRe: how to save Image or Bitmap to svg file Pin
OriginalGriff29-Jul-22 3:19
mvaOriginalGriff29-Jul-22 3:19 
AnswerRe: how to save Image or Bitmap to svg file Pin
Gerry Schmitz29-Jul-22 9:38
mveGerry Schmitz29-Jul-22 9:38 
AnswerRe: how to save Image or Bitmap to svg file Pin
Calin Negru30-Jul-22 3:42
Calin Negru30-Jul-22 3:42 
QuestionCan you use sqlite in vs2022? CLOSED Pin
mo149228-Jul-22 14:18
mo149228-Jul-22 14:18 
AnswerRe: Can you use sqlite in vs2022? CLOSED Pin
OriginalGriff28-Jul-22 20:00
mvaOriginalGriff28-Jul-22 20:00 
QuestionC# Set voice in Text to Speech Pin
Rockallica27-Jul-22 18:02
Rockallica27-Jul-22 18: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 21:16
mvaOriginalGriff27-Jul-22 21:16 
GeneralRe: C# Set voice in Text to Speech Pin
Rockallica28-Jul-22 9:39
Rockallica28-Jul-22 9:39 
GeneralRe: C# Set voice in Text to Speech Pin
OriginalGriff28-Jul-22 9:52
mvaOriginalGriff28-Jul-22 9:52 
QuestionIn C# can't introduce a formula in Excel Pin
Ismael_199927-Jul-22 13:37
Ismael_199927-Jul-22 13:37 
AnswerRe: In C# can't introduce a formula in Excel Pin
trønderen27-Jul-22 13:55
trønderen27-Jul-22 13:55 
AnswerRe: In C# can't introduce a formula in Excel Pin
Gerry Schmitz27-Jul-22 15:47
mveGerry Schmitz27-Jul-22 15:47 
GeneralRe: In C# can't introduce a formula in Excel Pin
Ismael_199928-Jul-22 8:53
Ismael_199928-Jul-22 8: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
swethamaddi27-Jul-22 0:20
swethamaddi27-Jul-22 0: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 MacCutchan27-Jul-22 0:51
mveRichard MacCutchan27-Jul-22 0: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 7:57
mveDave Kreskowiak27-Jul-22 7: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
swethamaddi27-Jul-22 0:15
swethamaddi27-Jul-22 0: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 MacCutchan27-Jul-22 0:51
mveRichard MacCutchan27-Jul-22 0: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 1:04
mvaOriginalGriff27-Jul-22 1: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 1:11
Calin Negru28-Jul-22 1:11 
QuestionHow to convert pdf file into FileStream? Pin
Code4Ever26-Jul-22 7:35
Code4Ever26-Jul-22 7:35 
GeneralRe: How to convert pdf file into FileStream? Pin
Richard MacCutchan26-Jul-22 7:49
mveRichard MacCutchan26-Jul-22 7:49 
GeneralRe: How to convert pdf file into FileStream? Pin
Code4Ever26-Jul-22 7:59
Code4Ever26-Jul-22 7: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.