none
System.Speech.Synthesis SpeechSynthesizer default output device ignores configuration RRS feed

  • Question

  • When I configure TTS Default output device to a certain device, via Control Panel->SpeechRecognition->Text To Speech tab, Advanced, Use this audio output device, The "Preview Voice" button plays the TTS over the specified device. In my c# code, using the System.Speech.Synthesis.SpeechSynthesizer the TTS is delivered over the default audio device, not the configured device. It appears that the SpeechSynthesizer class is ignoring the Default TTS audio device. I would like to be able to receive the SpeechSynthesizer events during playback, so using the play to streams is not useful.

    Has anyone else experienced this or found a work around?

    Thanks.

    Wednesday, December 18, 2019 7:01 PM

All replies

  • Hi 609lars,

    Thank you for posting here.

    I make a test which using SpeechSynthesizer.SetOutputToDefaultAudioDevice method to send output to the default audio device.

    As suggested in the document, you can use the 'Sound' window in the Windows Control Panel to configure the default audio device for the computer.

    Hope it can help you.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, December 19, 2019 7:35 AM
    Moderator
  • Thank you for taking a look. I think there might be some confusion around the language of the sound devices. I am trying to have all TTS output go to a different device than the "Default Audio Device". I am configuring the "Default TTS Audio Device". 

    On the Speech Properties screen, under the Text To Speech tab, there are 2 buttons. One says Audio Output, the other says Advanced. The Audio Output button sets the "Default Audio Output" for everything on the machine. The Advanced button takes you to the "Text To Speech Output Settings" screen. On this screen you would select the radio button "Use this audio output device" and in the pulldown select a different audio device than the "Default Audio Device". I test with USB speakers for the Default Audio Device, and Headsets on the sound card for the "Default TTS Audio device". When I press the Preview Voice button, the TTS is played on the configured "Default TTS Audio device". But when using the SpeechSynthesizer the sound is played on the "Default Audio Device". 

    I hope that helps you reproduce the issue.

    Thank you for your assistance.

    Neil

    Thursday, December 19, 2019 5:08 PM
  • Hi 609lars,

    Thanks for your feedback.

    I find that the output audio device will change if I change the default device in 'Audio output'.

    My test code.

            static void Main(string[] args)
            {
                SpeechSynthesizer synth = new SpeechSynthesizer();
                synth.SetOutputToDefaultAudioDevice(); 
                synth.Speak("This example demonstrates a basic use of Speech Synthesizer");
                Console.WriteLine();
                Console.ReadKey();
            }
     

    'Use this audio output device' in 'Advanced' cannot change the output audio device based on my code.

    If I have any misunderstanding, please provide some code here. It will help us to reproduce your problem.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 23, 2019 8:44 AM
    Moderator
  • Thank you for confirming the problem. At this time, there is no way to direct TTS speech to a specific audio device and still receive the TTS progress Events that come with a PlayAsync. This is required for some Non Visual Accessibility users. 

    Neil

    Monday, December 23, 2019 3:38 PM
  • Hi 609lars,

    I find two related references about your question.

    1. SpeechSynthesizer - selecting alternate output device
    2. How do you change the audio device in using System.Speech.Synthesis

    Hope them could be helpful.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 24, 2019 3:18 AM
    Moderator