change the default voice on windows 7 via C# code - c#

I need to change the windows 7 current default voice (Microsoft Anna and an extra German voice is installed) via C# code.
As I am a beginner programmer, it will be difficult for me to find it out on my own.
Any ideas how I can achieve it? Thank you all in advance for the replies!

The Windows 7 Audio API includes the SpeechSynthesizer class, you could call for example the SelectVoice method:
Use the GetInstalledVoices method and VoiceInfo class to obtain the
names of installed text-to-speech (TTS) voices that you can select. To
select a voice, pass the entire contents of the Name property as the
argument for the SelectVoice method. The SpeechSynthesizer object
selects the first installed voice that contains name in the voice's
VoiceInfo.Name property. The SpeechSynthesizer performs a
case-sensitive, substring comparison to determine if the voice matches
the name.
Edit: I found some sample code to get you started.

Windows 7 Default Voice (changing) Utility – Path:
Windows
Syswow64
Speech
Speechux
sapi.cpl

You can change the speed, volume, and pitch of the voice Narrator uses. and it wont need any C# coding...
Open Narrator by clicking the Start button , clicking All Programs, clicking Accessories, clicking Ease of Access, and then clicking Narrator.
Click Voice Settings, and then make any of the following adjustments:
To select a different voice, click the voice you want to use in the Select Voice box.
For a faster voice, select a number in the Set Speed list. The higher the number, the faster the voice.
For a louder voice, select a number in the Set Volume list. The higher the number, the louder the voice.
For a higher-pitched voice, select a number in the Set Pitch list. The higher the number, the higher the pitch. A higher-pitched voice can make the voice easier for some people to hear.
Narrator is not available in all languages, so if the steps above do not work, Narrator is not available for your language.

Related

Can't SELECT and ENABLE Voice Input on PC (non build in microphone)

I have a program (written on C#) which should record some speech and analyze & do something. But the problem is that I'm using desktop PC and it has not build in mic (that's why program does not records anything). I've tested it on laptop (what has build in mic) and it is working.
So can someone help me and explain how can I get plugged in mics list and choose the right one that I need and activate it (or some other decision)? I've made a research but seems like its impossible to do on C#, So i might consider C++ dev help too.
Thanks in advance.
The low-level (Win32) functions are waveInGetNumDevs (returns number of devices) and waveInOpen (identifies sources by a number from 0 to waveInGetNumDevs()-1).
For a nicer list, use waveInGetDevCaps to query the devices.

Speech recognition not working well in noise room. how i can improve it?

I write code for speech recognition on Visual studio in C#
My Speech Recognition program not working well in noise.
For example when i give voice input it gives output but some times it detects other voices in the room too and give output randomly. Even output not match with my input.
Please help me to improve it.
Thanks In Advance :)
Setup the microphone, go to control panel, then ease of access, then speech recognition, then set up microphone. This will base the mic dbz based on your voice.
Once that is done, you can run the program. Most people never set up the microphone. I have done this before and it always helps. Also if your using internal mics on the PC. You will get feedback. I suggest using a USB mic or wireless mic. They usually have noise cancelling technology.
I use them for all my projects using System.Speech. I also recommend turning the dbz down as well.

Change Speech Voice in Speech API

How do we change the voice to be used from within our apps? I cannot seem to figure out what or where the default voices are for Windows 8.
I've read articles online that say that Microsoft David is MS Windows 8's latest and greatest voice, but I have a new Windows 8 Pro system and no such voice exists on my system (only Zira and some other guy).
I am awware of Select Voice which lets you use a string as the Name of the voice, but after trying about 30 different names, including David (and Dave), it throws an exception saying that voice does not exist.
I have tried InstalledVoice - but not sure how to use that.
How/where can we download different voices to be used with Windows Speech Recognition, and how do we select different voices to be used from within our code?
Also, SelectVoicebyHints() does absolutely nothing at all. I don't know why.
The SpeechSynthesizer has a GetInstalledVoices method which returns a ReadOnlyCollection of Voices installed in your system (InstalledVoice type), in order to change the synthesizer voice you should call the SelectVoice Method in which requires the voice name(String type)
SpeechSynthesizer synt = new SpeechSynthesizer();
IReadOnlyCollection<InstalledVoice> InstalledVoices = synt.GetInstalledVoices();
InstalledVoice InstalledVoice = InstalledVoices.First();
synt.SelectVoice(InstalledVoice.VoiceInfo.Name);
synt.Speak("This is how you select an installed voice");
To see what voices are installed in your computer you can see them in:
Control Painel -> Speech Recognition -> Text to Speech
You can specify more info there as well like voice speed
if you want to add more voices to your computer you should search some company like
Ivona - http://www.ivona.com/us/for-individuals/voices-for-windows/
Not sure but SelectVoicebyHints should try to selected any voice from those installed where is more alike to the specifications that you passed through the method

how to make call from pc using local landline phone services

I have a desktop application of address diary, developed in C# .Net.
I want to make call from software throw land line phone service,
in my office we have 8 phone lines, so i want to select line before call,
i want to use headphone and mic in place of phone instrument.
how to connect phone lines to pc. i have more then 8 phone lines
is it possible ? if yes then how and which hardware i need for this.
Have you thought of the Skype API: http://developer.skype.com/public/skypekit
or
http://www.twilio.com
Get rid of the landlines and use a service. Much easier in my opinion. Then it would be far more scalable as well.
If you want to go down the telephony services path check out this library: https://github.com/markjulmar/atapi.net/
Hardware for landlines would just include 8 modems and selecting which one to use, before making a call.
I would assume that the atapi library contains functions to select the audio input and output. If not there are plenty of c# libraries for recording audio, in which you could pass the stream through to the library.
I wasn't going to point you down this direction but as per #Saif Khan comment you can use Asterix.
Using Asterix
Step 1 - Get a server install Asterix on it. http://www.asterisk.org. It's open source.
Step 2 - Get supported hardware e.g. http://www.asterisk.org/hardware
Step 3 - Communicate to it with http://sourceforge.net/projects/asterisk-dotnet/ (open source c# to asterisk library.
This maybe overkill for you, I don't know. I suppose I shouldn't assume :)
Since Google Voice is still free in United States and Canada. You can use this Google Voice API in C#.
http://sourceforge.net/projects/gvoicedotnet/
Doesn't want to sound like a noob, but did you try out Windows Dialer? You will need x number of 56k dialup voice modem depending on the no. of connections you have and you want to use.
It should work just fine. Test it out, and if it works well, you can get your app synced with your existing software to export the number to the dialer upon calling. (There is no such functions on the dialer app yet.)

How can I use speech recognition with C# on Windows XP? + do I need to train every pc that runs the app?

I am making a robot that responds to few voice commands. I am using Windows XP and C# to achieve that. My only problem is that I don't know how to use speech recognition with C#.
I've been searching Google and MSDN, but I did not find any beginner friendly tutorial yet..
Any suggestions??
Also, I know -from my experience with windows' speech recognition in M$ word- that I need to train the computer before starting the speech recognition application. This may cause a big problem for me because I may need to present my robot using different computers/or/different people may be the presenters.
So is there any way to make a predefined list of words that any user can say to the application without having to train it first???
Thanks for help!
Yes, you'll have to train anything that uses pattern recognition to respond to things. In Philadelphia, they pronounce "water" as "wudder". How could an algorithm figure that out? A predefined list would require you to have a working knowledge of every accent in the target sales countries.
SAPI 5.4 in Windows 7 does a very good job of recognizing limited command & control grammars without training.
If you keep your command set (grammar) small (say, no more than 10-15 commands), you should be able to get good results.
Dictation or a large command set requires training; there's just too much uncertainty.

Categories

Resources