none
SpeechSynthesizer - selecting alternate output device RRS feed

  • Question

  • A small section of our app uses this class, and it works "great" for announcing people entering and leaving. We use the "SpeakAsync" option to output the text (example: "Joe has entered") into the MS Sam voice.

    Some of our clients have multiple audio output devices such as both a headset and speakers. I'm sure there are multiple types available, including high definition etc etc.. About the only thing I can see in the class, is the choice of "SetOutputToDefaultAudioDevice".

    How can I enumerate the list of possible output devices, and tell the SpeechSynthisizer to use one of those?

    Thanks kindly in advance :)

    Friday, January 2, 2015 7:29 PM

Answers

All replies

  • Yea, using speech from Microsoft is always a suggestion to look to another supplier then Microsoft experience.

    SetToDefaulAudioDevice means in my idea only that there are no other choices beside set to wav or set to stream.

    There is an upcoming framework 4.5 and 4.6 but that seems more a bug fixing version than really something new.

    Microsoft developers were always struggling that they had to listen by some Microsoft manager who told that Open Source developers did it better. I wish that this was done by the real old very well Microsoft developers.


    Success
    Cor



    Friday, January 2, 2015 8:07 PM
  • I suppose use Pinvoke statements for Visual Basic.

    ISpVoice::SetOutput (SAPI 5.4)


    La vida loca

    Saturday, January 3, 2015 1:58 AM
  • I've been developing for a long time, and it seems at every "improvement" that Microsoft makes, they have failed to use their thinking caps.
    Saturday, January 3, 2015 7:49 PM
  • I looked at your link, and it seems that function comes from a COM object. When I added in the reference to the VB project, it seemed to copy an interop dll to my project directory. I'll be honest and say I've had little experience in dealing with 'pinvoke' so... And I'm guessing that since it copied it, then that means I also have to distribute it with my program, should I be forced to go that route?

    That would be insane.

    WHY Microsoft would create such a nice function, and then omit support for actually DOING anything with it, really peeves me.

    I need a way to look at the users sound devices, present them as options for putting the text speech out. NOT having those available is so pre 1950's programming.

    Saturday, January 3, 2015 7:56 PM
  • I've been developing for a long time, and it seems at every "improvement" that Microsoft makes, they have failed to use their thinking caps.

    For sure I wouldn't say "every", but sometimes they put something on the market like a little fish to catch bigger fishes. 

    Often there is no bite, and then it dies slowly without that they tell it.

    I'm sure this will come, because it is of course impossible to think that you make programs for mobile purposes and then there is no good possibility for speech.

    Be aware Microsoft has done already much effort in it. However, only the responses from the market will make it better.


    Success
    Cor

    Saturday, January 3, 2015 11:18 PM
  • I looked at your link, and it seems that function comes from a COM object. When I added in the reference to the VB project, it seemed to copy an interop dll to my project directory. I'll be honest and say I've had little experience in dealing with 'pinvoke' so... And I'm guessing that since it copied it, then that means I also have to distribute it with my program, should I be forced to go that route?

    That would be insane.

    WHY Microsoft would create such a nice function, and then omit support for actually DOING anything with it, really peeves me.

    I need a way to look at the users sound devices, present them as options for putting the text speech out. NOT having those available is so pre 1950's programming.

    I don't even know if that capability would work as I've not tried it.

    Of course you could write code so your app gets the default audio output device, provides the UI with the list of audio output devices available, the user selects an audio output device for use with System.Speech, your app alters the systems default audio output device to that device, system speech sets to the new default audio output device, your app returns the systems default audio output device back to the original default audio output device.

    I don't know if that would work either. I only have one audio ouput device therefore can not test something like that.


    La vida loca

    Sunday, January 4, 2015 2:34 AM
  • Also the only thing I've found for altering the default audio device appears to be in C++.

    Here's three links for it.

    Programmatically changing the default audio playback device on Windows 7

    Programmatically (or Command Line) change the default sound playback device in Windows 7

    GitHub marcjoha/AudioSwitcher

    Note in the 2nd link it says "Microsoft kept the API which changes the default sound playback device closed, for good reason. Drivers and control applet applications from different manufactures would mostly certainly end up "fighting" over the default device, which would be terribly confusing and effectively makes the hardware incompatible.".


    La vida loca

    Sunday, January 4, 2015 3:41 AM