TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
luca ravera
NA
2
2.7k
voice recognition request complete code
Jan 5 2019 2:52 PM
Greetings to all, I ask you for courtesy if you can help me, I just started using C #, I'm exploring the voice recognition so for study and curiosity, The program listens my voice and write result in the cmd Windows prompt , I have to get that if the voice result is the word open Browser NaMe is done starting the browserprocess .
read the cmd result and if result corresponds for example MyBrowser.exe program start Browser Mybrowser.exe.
thank you so much for your help .
using
System;
using
System.ComponentModel;
using
System.Diagnostics;
using
System.Threading.Tasks;
using
Microsoft.CognitiveServices.Speech;
namespace
helloworld
{
class
Program
{
public
static
async Task RecognizeSpeechAsync()
{
// Creates an instance of a speech config with specified subscription key and service region.
// Replace with your own subscription key and service region (e.g., "westus").
var config = SpeechConfig.FromSubscription(
"mykey"
,
"westus"
);
// Creates a speech recognizer.
using
(var recognizer =
new
SpeechRecognizer(config))
{
Console.WriteLine(
"Say something..."
);
// Performs recognition. RecognizeOnceAsync() returns when the first utterance has been recognized,
// so it is suitable only for single shot recognition like command or query. For long-running
// recognition, use StartContinuousRecognitionAsync() instead.
var result = await recognizer.RecognizeOnceAsync();
// Checks result.
if
(result.Reason == ResultReason.RecognizedSpeech)
{
Console.WriteLine($
"We recognized: {result.Text}"
);
}
else
if
(result.Reason == ResultReason.NoMatch)
{
Console.WriteLine($
"NOMATCH: Speech could not be recognized."
);
}
else
if
(result.Reason == ResultReason.Canceled)
{
var cancellation = CancellationDetails.FromResult(result);
Console.WriteLine($
"CANCELED: Reason={cancellation.Reason}"
);
if
(cancellation.Reason == CancellationReason.Error)
{
Console.WriteLine($
"CANCELED: ErrorCode={cancellation.ErrorCode}"
);
Console.WriteLine($
"CANCELED: ErrorDetails={cancellation.ErrorDetails}"
);
Console.WriteLine($
"CANCELED: Did you update the subscription info?"
);
}
}
}
}
static
void
Main()
{
RecognizeSpeechAsync().Wait();
Console.WriteLine(
"Please press a key to continue."
);
Console.ReadLine();
}
}
}
Reply
Answers (
1
)
How to set Indian Rupee Symbol in PDF using itextsharp?
development versus production access