bruxo00
bruxo00

Reputation: 143

Change audio output device for SpeechSynthesizer

I'm doing some tests with the speech functions on C#, but I don't know how do I change the Audio Output Device from default to another one, in this case Virtual Audio Cable.

My function:

    private void Say()
    {
        using (SpeechSynthesizer synth = new SpeechSynthesizer())
        {
            string str = textBox1.Text;

            //synth.SetOutputToDefaultAudioDevice();
            synth.Volume = 100;
            synth.Rate = 2;
            synth.Speak(str);
        }
    }

This is streaming the audio to my default playback device, but I want it to stream to Virtual Audio Cable one. How can I do that?

There are some functions but I don't know if they are used for this:

  1. SetOutputToAudioStream
  2. SetOutputToWaveStream

Can someone help me? Thanks =P

Upvotes: 1

Views: 1079

Answers (1)

bruxo00
bruxo00

Reputation: 143

Just figured out using naudio.codeplex.com

Upvotes: 0

Related Questions