Friday, August 26, 2011

Know Ur PC

Here is a COde written in VBscript that allows u to know the Gender of ur PC and what it expects from u(optional).............!!!

step 1: Open Notepad

step 2: CreateObject("SAPI.SpVoice").Speak "I love YOU!"

step 3: Save the file with any .vbs extension say (love.vbs).

step 4: Run the file.

->> CreateObject() is used to create a new instance of an object resides in a given library.
->> SAPI
is the name of the Speech API library stored in Windows Registry.
->> SpVoice
is the class name.

Note: U can also Build the files that makes a System speak using C# code.

using SpeechLib;

static void Main()
{
Console.WriteLine("Enter the text to read:");
string txt = Console.ReadLine();
txt.Speak();
}
static void Speak(this string text)
{
SpVoice voice = new SpVoiceClass();
voice.Speak(text, SpeechVoiceSpeakFlags.SVSFDefault);
}

Run the file is Visual Studio(any version) or any other editor that supports this code.

No comments: