Azure Speech Services를 사용하여 회의록 앱 만들기 ①
6498 단어 Azure.NETFrameworkSpeechToTextC#
의사록 app 작성까지 이하 2개를 시험해 보았습니다.
1) Speech SDK를 사용하여 .NET Framework 기반으로 음성을 인식하는 프로그램을 만듭니다 (이번 기사)
2) Javascript 기반으로 작성하여 Web App로 Deploy 해 본다 (다음 기사)
Speech SDK를 사용하여 .NET Framework 기반으로 음성을 인식하는 프로그램 만들기
아래의 순서로 음성인식을 하는 프로그램을 작성했습니다.
①Visual Studio 2019 설치
②.NET Framework의 Console App 프로젝트 만들기
③Speech SDK NuGet 패키지 설치
④Debug 설정
④Azure Portal에서 Speech Services Deploy
⑤코드 작성
⑥Debug/음성인식
①Visual Studio 2019 설치
아래에서 Visual Studio 설치를 실시합니다 (모처럼이므로 2019를 사용합시다!)
h tps://ゔぃすあ lsつぢ오. 미 c 로소 ft. 코 m / 드w 응아 ds /? 우 tm_ m ぢ m = 미 c로소 ft & 우 tm_ 그렇게 r 세 = cs. 미 c 로소 ft. 코 m & tm_ 또는 m 빠 gn = 부탄 + c 타 & tm_ 콘텐 t = 드 w 응 아 d + vs 2019
.NET Framework용 Console App 프로젝트 만들기
새 프로젝트 만들기에서 아래와 같이 콘솔 앱(.NET Framework)을 선택합니다.

Speech SDK NuGet 패키지 설치
오른쪽 상단의 솔루션 패키지 관리에서 Nuget을 솔루션을 찾아 프로젝트에 Microsoft.CognitiveServices.Speech를 설치합니다.

디버그 설정
올바르게 빌드하기 위해 자신의 환경에 맞춰 빌드를 구성합니다.
(빌드/구성 매니저에서 설정)
64bit 환경 → x64
32bit 환경 → x84

Azure 포털에서 Speech Services 배포
Azure 포털에서 Speech를 검색하고 배포합니다. Key와 Region은 메모해 둡니다.

나중에 코드에 쓰는 Key와 Region이지만,
Region은 다음 지침에 따라 올바른 값을 입력합니다.
htps : // / cs. 미 c 로소 ft. 코 m / 자 jp / 아즈레 / 코 g 치 ゔ ぇ - r ゔ ぃせ s / s ぺえ ch r ゔ ぃ 세 / 레기 온 s
중앙 아메리카에서 했으므로 'centralus'를 입력합니다.
코드 작성
MS Docs의 샘플 코드 끈적이지만 아래의 코드를 "Priogram.cs"에 복사하십시오.
(이 때 Key와 Region을 자신의 것으로 설정합니다.)
using System;
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("YourSubscriptionKey", "YourServiceRegion");
// Creates a speech recognizer.
using (var recognizer = new SpeechRecognizer(config))
{
Console.WriteLine("Say something...");
// Starts speech recognition, and returns after a single utterance is recognized. The end of a
// single utterance is determined by listening for silence at the end or until a maximum of 15
// seconds of audio is processed. The task returns the recognition text as result.
// Note: Since RecognizeOnceAsync() returns only a single utterance, it is suitable only for single
// shot recognition like command or query.
// For long-running multi-utterance 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();
}
}
}
Debug/음성 인식
여기까지 할 수 있으면 디버그합니다.
「Speach Something」이 나오므로, 뭔가 영어의 음성을 발한다고 인식해 줍니다.
(일본어라도 이켈같지만 정밀도가 그다지 좋지 않습니다)

다음에는 자바스크립트 기반으로 모바일에서 실행되는 웹 앱을 작성해 보겠습니다.
참조 기사
Speech Service가 지원되는 지역
htps : // / cs. mic로소 ft. 코 m / 자 jp / 아즈레 / 코 g 치 ゔ ぇ - r ゔ ぃせ s / s ぺえ ch r ゔ ぃ 세 / 레기 온 s
빠른 시작: .NET Framework(Windows)용 Speech SDK를 사용하여 음성 인식
htps : // / cs. mic로소 ft. 코 m / 자 jp / 아즈레 / 코 g 치 ゔ ぇ r ゔ ぃ せ s / s ぺえ ch r ゔ ぃ せ / 쿠크 cks rtc 샤 rp t t t ws
Reference
이 문제에 관하여(Azure Speech Services를 사용하여 회의록 앱 만들기 ①), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/komiyasa/items/b6e294b98a6974446d39텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)