Ejemplo del proyecto realizado en esta clase.
Introducci贸n
驴Qu茅 son los servicios cognitivos?
Funciones de cognitive services
Setup del ambiente
Privacidad y seguridad
Lenguaje
Procesamiento de texto
Escenarios de uso y consideraciones
An谩lisis de sentimiento
Detecci贸n y traducci贸n de textos
Utilizando Text Analytics
Voz
Oportunidades con procesamiento de voz
Convierte texto en voz
Convierte voz a texto
Traducci贸n de voz
Reconocimiento de voz
Visi贸n
Oportunidades con visi贸n computacional
An谩lisis de imagen con computer visi贸n
Extracci贸n de textos en im谩genes utilizando OCR
Reconocimiento facial
Obteniendo atributos de rostros
Utilizando la librer铆a de Face
LUIS
Conoce a LUIS
Creando el modelo de entendimiento de lenguaje y planeaci贸n de la app
Identificando la intenci贸n del usuario
Utiliza modelos predise帽ados
Entrena al modelo
Integrando LUIS a nuestra aplicaci贸n
Conclusiones
Despedida
You don't have access to this class
Keep learning! Join and start boosting your career
The speech-to-text service transforms audio into text using advanced cognitive technology. To start using it, it is essential to have a subscription to Azure's cognitive service. Here you will learn how to set it up from scratch in a Visual Studio environment, using C# and some additional tools to work with the file system and asynchronous methods.
Microsoft.CognitiveServices.Speech
and add the package.Go to the Azure portal:
keys and endpoint
section.In Visual Studio, configure the subscription and region in your application with speech config:
using var speechConfig = SpeechConfig.FromSubscription("YourSubscriptionKey", "WestUS");
async static Task FromMic
.using var audioConfig = AudioConfig.FromDefaultMicrophoneInput();using var recognizer = new SpeechRecognizer(speechConfig, audioConfig);
var result = await recognizer.RecognizeOnceAsync();Console.WriteLine("You said: " + result.Text);
async static Task FromFile
.using var audioConfig = AudioConfig.FromWavFileInput("test.wav");
var result = await recognizer.RecognizeOnceAsync();Console.WriteLine("The result is: " + result.Text);
To execute correctly, set the signature of the Main
method in the console program to work with asynchronous tasks, and invoke the methods as you need to work from a microphone or an audio file:
static async Task Main(){ var speechConfig = SpeechConfig.FromSubscription("YourSubscriptionKey", "WestUS"); await FromMic(speechConfig); // or await FromFile(speechConfig); Console.ReadLine();}
And there you have it! With these instructions, you will be able to implement and test the speech-to-text service using both microphone inputs and audio files. By exploring the course repository, you will also find more advanced examples. Become a speech processing expert by taking advantage of these tools.
Contributions 5
Questions 3
Ejemplo del proyecto realizado en esta clase.
Un servicio de la vida real que usa esta tecnolog铆a, es el men煤 de alg煤n banco, que te pide decir los n煤meros de tu tarjeta para no digitarlos en el teclado del tel茅fono. Es muy com煤n en USA y por supuesto, detecta a los hispanohablantes.
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.CognitiveServices.Speech;
using Microsoft.CognitiveServices.Speech.Audio;
class Program
{
async static Task Main(string[] args)
{
var speechConfig = SpeechConfig.FromSubscription("0d0fcb275cf949ce8cdc32c215da56ed", "westus");
Console.WriteLine("Hello world");
//await FromMic(speechConfig);
await FromFile(speechConfig);
Console.ReadLine();
}
async static Task FromMic(SpeechConfig speechConfig)
{
using var audioConfig = AudioConfig.FromDefaultMicrophoneInput();
using var recognizer = new SpeechRecognizer(speechConfig, "es-MX" audioConfig);
Console.WriteLine("Habla al microfono");
var result = await recognizer.RecognizeOnceAsync();
Console.WriteLine("Tu dijiste lo siguiente : " + result.Text);
}
async static Task FromFile(SpeechConfig speechConfig)
{
using var audioConfig = AudioConfig.FromWavFileInput("test.wav");
using var recognizer = new SpeechRecognizer(speechConfig, audioConfig);
var result = await recognizer.RecognizeOnceAsync();
Console.WriteLine("El resultado es : " + result.Text);
}
}
}
Este tipo de servicio se puede usar para comunicarse con asistentes de voz, similares a Amazon Echo.
La clase a utlizar es SpeechRecognizer
Want to see more contributions, questions and answers from the community?