The app requires to use speech commands base upon the current time. Where to start to incorporate speech command.
To give a quick overview the app will be design to talk, speak, or say the current time. Can someone point me in the right direction on a good tutorial?
AmanPosted Aug 11, 2014, 6:22 PM
{
//Getting Current DateTime
DateTime date = DateTime.Now;
DateTime dt;
//Creating the Pattern for getting the Time in XX:XX AM/PM format
//or if you want to add also the seconds you have to just write like "hh:mm:ss tt"
string pattern = "hh:mm tt";
string mydate = "";
//Specifying the Kind of Date and Time form like Local or UST
dt = DateTime.SpecifyKind(date,DateTimeKind.Local);
//Setting the Pattern for the Currnt Date Time and save it into a String
mydate =dt.ToString(pattern);
//Creating an Instance for SpeechSynthesizer
SpeechSynthesizer speech = new SpeechSynthesizer();
//Passing the String formatted Time into the Method
await speech.SpeakTextAsync(mydate);
}
One thing you should keep in mind that you need to add the Capabilities for SpeechToText from Wmappmanifest file , make sure that ID_CAP_SPEECH_RECOGNITION is checked.