Megosztás a következőn keresztül:


Rövid útmutató: Valós idejű diarizálás létrehozása

Referenciadokumentáció-csomag (NuGet) | További minták a GitHubon |

Ebben a rövid útmutatóban valós idejű diarizálással futtat egy alkalmazást a beszéd és a szöveg átírásához. A diarizálás megkülönbözteti a beszélgetésben részt vevő különböző előadókat. A Speech szolgáltatás információt nyújt arról, hogy melyik beszélő beszélt az átírt beszéd egy bizonyos részén.

Az előadói adatok szerepelnek az eredményben a beszélőazonosító mezőben. A beszélőazonosító egy általános azonosító, amelyet a szolgáltatás minden beszélgetési résztvevőhöz hozzárendel a felismerés során, mivel a megadott hangtartalmak különböző hangszórókat azonosítanak.

Tipp.

A Speech Studióban valós idejű szövegfelolvasást is kipróbálhat anélkül, hogy regisztrálná vagy írná a kódot. A Speech Studio azonban még nem támogatja a diarizálást.

Előfeltételek

  • Azure-előfizetés. Ingyenesen létrehozhat egyet.
  • Speech-erőforrás létrehozása az Azure Portalon.
  • Kérje le a Speech erőforráskulcsát és régióját. A Speech-erőforrás üzembe helyezése után válassza az Ugrás az erőforrásra lehetőséget a kulcsok megtekintéséhez és kezeléséhez.

A környezet beállítása

A Speech SDK NuGet-csomagként érhető el, és a .NET Standard 2.0-t implementálja. Az útmutató későbbi részében telepítheti a Speech SDK-t, de először ellenőrizze az SDK telepítési útmutatóját a további követelményekkel kapcsolatban.

Környezeti változók beállítása

Az Azure AI-szolgáltatások eléréséhez hitelesítenie kell az alkalmazást. Ez a cikk bemutatja, hogyan tárolhatja a hitelesítő adatait környezeti változókkal. Ezután hozzáférhet a környezeti változókhoz a kódból az alkalmazás hitelesítéséhez. Éles környezetben biztonságosabban tárolhatja és érheti el a hitelesítő adatait.

Fontos

Az Azure-erőforrásokhoz tartozó felügyelt identitásokkal rendelkező Microsoft Entra ID-hitelesítést javasoljuk, hogy ne tárolja a hitelesítő adatokat a felhőben futó alkalmazásokkal.

HA API-kulcsot használ, biztonságosan tárolja valahol máshol, például az Azure Key Vaultban. Ne foglalja bele közvetlenül az API-kulcsot a kódba, és soha ne tegye közzé nyilvánosan.

Az AI-szolgáltatások biztonságáról további információt az Azure AI-szolgáltatásokhoz érkező kérelmek hitelesítése című témakörben talál.

A Speech-erőforráskulcs és -régió környezeti változóinak beállításához nyisson meg egy konzolablakot, és kövesse az operációs rendszer és a fejlesztési környezet utasításait.

  • A SPEECH_KEY környezeti változó beállításához cserélje le a kulcsot az erőforrás egyik kulcsára.
  • A SPEECH_REGION környezeti változó beállításához cserélje le a régiót az erőforrás egyik régiójára.
setx SPEECH_KEY your-key
setx SPEECH_REGION your-region

Feljegyzés

Ha csak az aktuális konzolon kell hozzáférnie a környezeti változókhoz, a környezeti változót set ahelyett setxállíthatja be.

A környezeti változók hozzáadása után előfordulhat, hogy újra kell indítania a környezeti változók olvasásához szükséges programokat, beleértve a konzolablakot is. Ha például a Visual Studiót használja szerkesztőként, indítsa újra a Visual Studiót a példa futtatása előtt.

Diarizáció megvalósítása fájlból beszélgetés átírásával

Az alábbi lépéseket követve hozzon létre egy konzolalkalmazást, és telepítse a Speech SDK-t.

  1. Nyisson meg egy parancssori ablakot abban a mappában, ahol az új projektet szeretné. A parancs futtatásával hozzon létre egy konzolalkalmazást a .NET CLI-vel.

    dotnet new console
    

    Ez a parancs létrehozza a Program.cs fájlt a projektkönyvtárban.

  2. Telepítse a Speech SDK-t az új projektbe a .NET CLI-vel.

    dotnet add package Microsoft.CognitiveServices.Speech
    
  3. Cserélje le a tartalomra Program.cs a következő kódot.

    using Microsoft.CognitiveServices.Speech;
    using Microsoft.CognitiveServices.Speech.Audio;
    using Microsoft.CognitiveServices.Speech.Transcription;
    
    class Program 
    {
        // This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION"
        static string speechKey = Environment.GetEnvironmentVariable("SPEECH_KEY");
        static string speechRegion = Environment.GetEnvironmentVariable("SPEECH_REGION");
    
        async static Task Main(string[] args)
        {
            var filepath = "katiesteve.wav";
            var speechConfig = SpeechConfig.FromSubscription(speechKey, speechRegion);        
            speechConfig.SpeechRecognitionLanguage = "en-US";
            speechConfig.SetProperty(PropertyId.SpeechServiceResponse_DiarizeIntermediateResults, "true"); 
    
            var stopRecognition = new TaskCompletionSource<int>(TaskCreationOptions.RunContinuationsAsynchronously);
    
            // Create an audio stream from a wav file or from the default microphone
            using (var audioConfig = AudioConfig.FromWavFileInput(filepath))
            {
                // Create a conversation transcriber using audio stream input
                using (var conversationTranscriber = new ConversationTranscriber(speechConfig, audioConfig))
                {
                    conversationTranscriber.Transcribing += (s, e) =>
                    {
                        Console.WriteLine($"TRANSCRIBING: Text={e.Result.Text} Speaker ID={e.Result.SpeakerId}");
                    };
    
                    conversationTranscriber.Transcribed += (s, e) =>
                    {
                        if (e.Result.Reason == ResultReason.RecognizedSpeech)
                        {
                            Console.WriteLine();
                            Console.WriteLine($"TRANSCRIBED: Text={e.Result.Text} Speaker ID={e.Result.SpeakerId}");
                            Console.WriteLine();
                        }
                        else if (e.Result.Reason == ResultReason.NoMatch)
                        {
                            Console.WriteLine($"NOMATCH: Speech could not be transcribed.");
                        }
                    };
    
                    conversationTranscriber.Canceled += (s, e) =>
                    {
                        Console.WriteLine($"CANCELED: Reason={e.Reason}");
    
                        if (e.Reason == CancellationReason.Error)
                        {
                            Console.WriteLine($"CANCELED: ErrorCode={e.ErrorCode}");
                            Console.WriteLine($"CANCELED: ErrorDetails={e.ErrorDetails}");
                            Console.WriteLine($"CANCELED: Did you set the speech resource key and region values?");
                            stopRecognition.TrySetResult(0);
                        }
    
                        stopRecognition.TrySetResult(0);
                    };
    
                    conversationTranscriber.SessionStopped += (s, e) =>
                    {
                        Console.WriteLine("\n    Session stopped event.");
                        stopRecognition.TrySetResult(0);
                    };
    
                    await conversationTranscriber.StartTranscribingAsync();
    
                    // Waits for completion. Use Task.WaitAny to keep the task rooted.
                    Task.WaitAny(new[] { stopRecognition.Task });
    
                    await conversationTranscriber.StopTranscribingAsync();
                }
            }
        }
    }
    
  4. Kérje le a minta hangfájlt , vagy használja a saját .wav fájlját. Cserélje le katiesteve.wav a fájl elérési útját és nevét .wav .

    Az alkalmazás felismeri a beszélgetés több résztvevőjének beszédét. A hangfájlnak több hangszórót kell tartalmaznia.

  5. A beszédfelismerés nyelvének módosításához cserélje le en-US egy másik támogatott nyelvre. Például a es-ES spanyol (Spanyolország) esetében. Az alapértelmezett nyelv az en-US , ha nem ad meg nyelvet. A több beszélt nyelv egyikének azonosításáról további információt a nyelvazonosítás című témakörben talál.

  6. Futtassa a konzolalkalmazást a beszélgetés átírásának elindításához:

    dotnet run
    

Fontos

Győződjön meg arról, hogy beállítja a környezeti és SPEECH_REGION a SPEECH_KEY környezeti változókat. Ha nem állítja be ezeket a változókat, a minta hibaüzenettel meghiúsul.

Az átírt beszélgetésnek szövegként kell kimenetnek lennie:

TRANSCRIBING: Text=good morning steve Speaker ID=Unknown
TRANSCRIBING: Text=good morning steve how are Speaker ID=Guest-1
TRANSCRIBING: Text=good morning steve how are you doing today Speaker ID=Guest-1

TRANSCRIBED: Text=Good morning, Steve. How are you doing today? Speaker ID=Guest-1

TRANSCRIBING: Text=good morning katie Speaker ID=Unknown
TRANSCRIBING: Text=good morning katie i hope Speaker ID=Guest-2
TRANSCRIBING: Text=good morning katie i hope you're having a great Speaker ID=Guest-2
TRANSCRIBING: Text=good morning katie i hope you're having a great start to Speaker ID=Guest-2
TRANSCRIBING: Text=good morning katie i hope you're having a great start to your day Speaker ID=Guest-2

TRANSCRIBED: Text=Good morning, Katie. I hope you're having a great start to your day. Speaker ID=Guest-2

TRANSCRIBING: Text=have you tried Speaker ID=Unknown
TRANSCRIBING: Text=have you tried the latest Speaker ID=Unknown
TRANSCRIBING: Text=have you tried the latest real time Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which can Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which can tell you Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which can tell you who said Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which can tell you who said what Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which can tell you who said what in Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which can tell you who said what in real time Speaker ID=Guest-1

TRANSCRIBED: Text=Have you tried the latest real time diarization in Microsoft Speech Service which can tell you who said what in real time? Speaker ID=Guest-1

TRANSCRIBING: Text=not yet Speaker ID=Unknown
TRANSCRIBING: Text=not yet i Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch trans Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization Speaker ID=Guest-2  
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization function Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produc Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces di Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature Speaker ID=Guest-2  
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to di Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to diarize Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to diarize in real Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to diarize in real time Speaker ID=Guest-2

TRANSCRIBED: Text=Not yet. I've been using the batch transcription with diarization functionality, but it produces diarization results after the whole audio is processed. Is the new feature able to diarize in real time? Speaker ID=Guest-2

TRANSCRIBING: Text=absolutely Speaker ID=Unknown
TRANSCRIBING: Text=absolutely i Speaker ID=Unknown
TRANSCRIBING: Text=absolutely i recom Speaker ID=Guest-1
TRANSCRIBING: Text=absolutely i recommend Speaker ID=Guest-1
TRANSCRIBING: Text=absolutely i recommend you give it a try Speaker ID=Guest-1

TRANSCRIBED: Text=Absolutely, I recommend you give it a try. Speaker ID=Guest-1

TRANSCRIBING: Text=that's exc Speaker ID=Unknown
TRANSCRIBING: Text=that's exciting Speaker ID=Unknown
TRANSCRIBING: Text=that's exciting let me try Speaker ID=Guest-2
TRANSCRIBING: Text=that's exciting let me try it right now Speaker ID=Guest-2

TRANSCRIBED: Text=That's exciting. Let me try it right now. Speaker ID=Guest-2

A beszélők a beszélgetésben szereplő előadók számától függően az 1. vendég, a 2. vendég stb. néven vannak azonosítva.

Feljegyzés

A korai köztes eredmények némelyikében megjelenhet Speaker ID=Unknown , ha a beszélő még nincs azonosítva. Köztes diarizálási eredmények nélkül (ha nem állítja be a PropertyId.SpeechServiceResponse_DiarizeIntermediateResults tulajdonságot "true" értékre), a beszélő azonosítója mindig "Ismeretlen".

Az erőforrások eltávolítása

Az Azure Portal vagy az Azure Parancssori felület (CLI) használatával eltávolíthatja a létrehozott Speech-erőforrást.

Referenciadokumentáció-csomag (NuGet) | További minták a GitHubon |

Ebben a rövid útmutatóban valós idejű diarizálással futtat egy alkalmazást a beszéd és a szöveg átírásához. A diarizálás megkülönbözteti a beszélgetésben részt vevő különböző előadókat. A Speech szolgáltatás információt nyújt arról, hogy melyik beszélő beszélt az átírt beszéd egy bizonyos részén.

Az előadói adatok szerepelnek az eredményben a beszélőazonosító mezőben. A beszélőazonosító egy általános azonosító, amelyet a szolgáltatás minden beszélgetési résztvevőhöz hozzárendel a felismerés során, mivel a megadott hangtartalmak különböző hangszórókat azonosítanak.

Tipp.

A Speech Studióban valós idejű szövegfelolvasást is kipróbálhat anélkül, hogy regisztrálná vagy írná a kódot. A Speech Studio azonban még nem támogatja a diarizálást.

Előfeltételek

  • Azure-előfizetés. Ingyenesen létrehozhat egyet.
  • Speech-erőforrás létrehozása az Azure Portalon.
  • Kérje le a Speech erőforráskulcsát és régióját. A Speech-erőforrás üzembe helyezése után válassza az Ugrás az erőforrásra lehetőséget a kulcsok megtekintéséhez és kezeléséhez.

A környezet beállítása

A Speech SDK NuGet-csomagként érhető el, és a .NET Standard 2.0-t implementálja. Az útmutató későbbi részében telepítheti a Speech SDK-t, de először ellenőrizze az SDK telepítési útmutatóját a további követelményekkel kapcsolatban.

Környezeti változók beállítása

Az Azure AI-szolgáltatások eléréséhez hitelesítenie kell az alkalmazást. Ez a cikk bemutatja, hogyan tárolhatja a hitelesítő adatait környezeti változókkal. Ezután hozzáférhet a környezeti változókhoz a kódból az alkalmazás hitelesítéséhez. Éles környezetben biztonságosabban tárolhatja és érheti el a hitelesítő adatait.

Fontos

Az Azure-erőforrásokhoz tartozó felügyelt identitásokkal rendelkező Microsoft Entra ID-hitelesítést javasoljuk, hogy ne tárolja a hitelesítő adatokat a felhőben futó alkalmazásokkal.

HA API-kulcsot használ, biztonságosan tárolja valahol máshol, például az Azure Key Vaultban. Ne foglalja bele közvetlenül az API-kulcsot a kódba, és soha ne tegye közzé nyilvánosan.

Az AI-szolgáltatások biztonságáról további információt az Azure AI-szolgáltatásokhoz érkező kérelmek hitelesítése című témakörben talál.

A Speech-erőforráskulcs és -régió környezeti változóinak beállításához nyisson meg egy konzolablakot, és kövesse az operációs rendszer és a fejlesztési környezet utasításait.

  • A SPEECH_KEY környezeti változó beállításához cserélje le a kulcsot az erőforrás egyik kulcsára.
  • A SPEECH_REGION környezeti változó beállításához cserélje le a régiót az erőforrás egyik régiójára.
setx SPEECH_KEY your-key
setx SPEECH_REGION your-region

Feljegyzés

Ha csak az aktuális konzolon kell hozzáférnie a környezeti változókhoz, a környezeti változót set ahelyett setxállíthatja be.

A környezeti változók hozzáadása után előfordulhat, hogy újra kell indítania a környezeti változók olvasásához szükséges programokat, beleértve a konzolablakot is. Ha például a Visual Studiót használja szerkesztőként, indítsa újra a Visual Studiót a példa futtatása előtt.

Diarizáció megvalósítása fájlból beszélgetés átírásával

Az alábbi lépéseket követve hozzon létre egy konzolalkalmazást, és telepítse a Speech SDK-t.

  1. Hozzon létre egy új C++ konzolprojektet a Visual Studio Community 2022-ben.ConversationTranscription

  2. Válassza az Eszközök>Nuget Csomagkezelő> Csomagkezelő konzol lehetőséget. A Csomagkezelő konzolon futtassa a következő parancsot:

    Install-Package Microsoft.CognitiveServices.Speech
    
  3. Cserélje le a tartalomra ConversationTranscription.cpp a következő kódot.

    #include <iostream> 
    #include <stdlib.h>
    #include <speechapi_cxx.h>
    #include <future>
    
    using namespace Microsoft::CognitiveServices::Speech;
    using namespace Microsoft::CognitiveServices::Speech::Audio;
    using namespace Microsoft::CognitiveServices::Speech::Transcription;
    
    std::string GetEnvironmentVariable(const char* name);
    
    int main()
    {
        // This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION"
        auto speechKey = GetEnvironmentVariable("SPEECH_KEY");
        auto speechRegion = GetEnvironmentVariable("SPEECH_REGION");
    
        if ((size(speechKey) == 0) || (size(speechRegion) == 0)) {
            std::cout << "Please set both SPEECH_KEY and SPEECH_REGION environment variables." << std::endl;
            return -1;
        }
    
        auto speechConfig = SpeechConfig::FromSubscription(speechKey, speechRegion);
        speechConfig->SetProperty(PropertyId::SpeechServiceResponse_DiarizeIntermediateResults, "true"); 
    
        speechConfig->SetSpeechRecognitionLanguage("en-US");
    
        auto audioConfig = AudioConfig::FromWavFileInput("katiesteve.wav");
        auto conversationTranscriber = ConversationTranscriber::FromConfig(speechConfig, audioConfig);
    
        // promise for synchronization of recognition end.
        std::promise<void> recognitionEnd;
    
        // Subscribes to events.
        conversationTranscriber->Transcribing.Connect([](const ConversationTranscriptionEventArgs& e)
            {
                std::cout << "TRANSCRIBING:" << e.Result->Text << std::endl;
                std::cout << "Speaker ID=" << e.Result->SpeakerId << std::endl;
            });
    
        conversationTranscriber->Transcribed.Connect([](const ConversationTranscriptionEventArgs& e)
            {
                if (e.Result->Reason == ResultReason::RecognizedSpeech)
                {
                    std::cout << "\n" << "TRANSCRIBED: Text=" << e.Result->Text << std::endl;
                    std::cout << "Speaker ID=" << e.Result->SpeakerId << "\n" << std::endl;
                }
                else if (e.Result->Reason == ResultReason::NoMatch)
                {
                    std::cout << "NOMATCH: Speech could not be transcribed." << std::endl;
                }
            });
    
        conversationTranscriber->Canceled.Connect([&recognitionEnd](const ConversationTranscriptionCanceledEventArgs& e)
            {
                auto cancellation = CancellationDetails::FromResult(e.Result);
                std::cout << "CANCELED: Reason=" << (int)cancellation->Reason << std::endl;
    
                if (cancellation->Reason == CancellationReason::Error)
                {
                    std::cout << "CANCELED: ErrorCode=" << (int)cancellation->ErrorCode << std::endl;
                    std::cout << "CANCELED: ErrorDetails=" << cancellation->ErrorDetails << std::endl;
                    std::cout << "CANCELED: Did you set the speech resource key and region values?" << std::endl;
                }
                else if (cancellation->Reason == CancellationReason::EndOfStream)
                {
                    std::cout << "CANCELED: Reach the end of the file." << std::endl;
                }
            });
    
        conversationTranscriber->SessionStopped.Connect([&recognitionEnd](const SessionEventArgs& e)
            {
                std::cout << "Session stopped.";
                recognitionEnd.set_value(); // Notify to stop recognition.
            });
    
        conversationTranscriber->StartTranscribingAsync().wait();
    
        // Waits for recognition end.
        recognitionEnd.get_future().wait();
    
        conversationTranscriber->StopTranscribingAsync().wait();
    }
    
    std::string GetEnvironmentVariable(const char* name)
    {
    #if defined(_MSC_VER)
        size_t requiredSize = 0;
        (void)getenv_s(&requiredSize, nullptr, 0, name);
        if (requiredSize == 0)
        {
            return "";
        }
        auto buffer = std::make_unique<char[]>(requiredSize);
        (void)getenv_s(&requiredSize, buffer.get(), requiredSize, name);
        return buffer.get();
    #else
        auto value = getenv(name);
        return value ? value : "";
    #endif
    }
    
  4. Kérje le a minta hangfájlt , vagy használja a saját .wav fájlját. Cserélje le katiesteve.wav a fájl elérési útját és nevét .wav .

    Az alkalmazás felismeri a beszélgetés több résztvevőjének beszédét. A hangfájlnak több hangszórót kell tartalmaznia.

  5. A beszédfelismerés nyelvének módosításához cserélje le en-US egy másik támogatott nyelvre. Például a es-ES spanyol (Spanyolország) esetében. Az alapértelmezett nyelv az en-US , ha nem ad meg nyelvet. A több beszélt nyelv egyikének azonosításáról további információt a nyelvazonosítás című témakörben talál.

  6. Az alkalmazás létrehozása és futtatása a beszélgetés átírásának elindításához:

    Fontos

    Győződjön meg arról, hogy beállítja a környezeti és SPEECH_REGION a SPEECH_KEY környezeti változókat. Ha nem állítja be ezeket a változókat, a minta hibaüzenettel meghiúsul.

Az átírt beszélgetésnek szövegként kell kimenetnek lennie:

TRANSCRIBING:good morning
Speaker ID=Unknown
TRANSCRIBING:good morning steve
Speaker ID=Unknown
TRANSCRIBING:good morning steve how are you doing
Speaker ID=Guest-1
TRANSCRIBING:good morning steve how are you doing today
Speaker ID=Guest-1

TRANSCRIBED: Text=Good morning, Steve. How are you doing today?
Speaker ID=Guest-1

TRANSCRIBING:good
Speaker ID=Unknown
TRANSCRIBING:good morning
Speaker ID=Unknown
TRANSCRIBING:good morning kat
Speaker ID=Unknown
TRANSCRIBING:good morning katie i hope you're having a
Speaker ID=Guest-2
TRANSCRIBING:good morning katie i hope you're having a great start to your day
Speaker ID=Guest-2

TRANSCRIBED: Text=Good morning, Katie. I hope you're having a great start to your day.
Speaker ID=Guest-2

TRANSCRIBING:have you
Speaker ID=Unknown
TRANSCRIBING:have you tried
Speaker ID=Unknown
TRANSCRIBING:have you tried the latest
Speaker ID=Unknown
TRANSCRIBING:have you tried the latest real
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time diarization
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time diarization in
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time diarization in microsoft
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time diarization in microsoft speech
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time diarization in microsoft speech service
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time diarization in microsoft speech service which
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time diarization in microsoft speech service which can
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time diarization in microsoft speech service which can tell you
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time diarization in microsoft speech service which can tell you who said
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time diarization in microsoft speech service which can tell you who said what
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time diarization in microsoft speech service which can tell you who said what in
Speaker ID=Guest-1
TRANSCRIBING:have you tried the latest real time diarization in microsoft speech service which can tell you who said what in real time
Speaker ID=Guest-1

TRANSCRIBED: Text=Have you tried the latest real time diarization in Microsoft Speech Service which can tell you who said what in real time?
Speaker ID=Guest-1

TRANSCRIBING:not yet
Speaker ID=Unknown
TRANSCRIBING:not yet i
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch trans
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization function
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces di
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to di
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to diarize
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to diarize in real
Speaker ID=Guest-2
TRANSCRIBING:not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to diarize in real time
Speaker ID=Guest-2

TRANSCRIBED: Text=Not yet. I've been using the batch transcription with diarization functionality, but it produces diarization results after the whole audio is processed. Is the new feature able to diarize in real time?
Speaker ID=Guest-2

TRANSCRIBING:absolutely
Speaker ID=Unknown
TRANSCRIBING:absolutely i
Speaker ID=Unknown
TRANSCRIBING:absolutely i recom
Speaker ID=Guest-1
TRANSCRIBING:absolutely i recommend
Speaker ID=Guest-1
TRANSCRIBING:absolutely i recommend you
Speaker ID=Guest-1
TRANSCRIBING:absolutely i recommend you give it a try
Speaker ID=Guest-1

TRANSCRIBED: Text=Absolutely, I recommend you give it a try.
Speaker ID=Guest-1

TRANSCRIBING:that's exc
Speaker ID=Unknown
TRANSCRIBING:that's exciting
Speaker ID=Unknown
TRANSCRIBING:that's exciting let me
Speaker ID=Guest-2
TRANSCRIBING:that's exciting let me try
Speaker ID=Guest-2
TRANSCRIBING:that's exciting let me try it right now
Speaker ID=Guest-2

TRANSCRIBED: Text=That's exciting. Let me try it right now.
Speaker ID=Guest-2

A beszélők a beszélgetésben szereplő előadók számától függően az 1. vendég, a 2. vendég stb. néven vannak azonosítva.

Feljegyzés

A korai köztes eredmények némelyikében megjelenhet Speaker ID=Unknown , ha a beszélő még nincs azonosítva. Köztes diarizálási eredmények nélkül (ha nem állítja be a PropertyId::SpeechServiceResponse_DiarizeIntermediateResults tulajdonságot "true" értékre), a beszélő azonosítója mindig "Ismeretlen".

Az erőforrások eltávolítása

Az Azure Portal vagy az Azure Parancssori felület (CLI) használatával eltávolíthatja a létrehozott Speech-erőforrást.

Referenciadokumentáció csomag (Go) | További minták a GitHubon |

A Go programozási nyelvHez készült Speech SDK nem támogatja a beszélgetés átírását. Válasszon egy másik programozási nyelvet vagy a Go referenciát és a cikk elejéről csatolt mintákat.

Referenciadokumentáció | További minták a GitHubon

Ebben a rövid útmutatóban valós idejű diarizálással futtat egy alkalmazást a beszéd és a szöveg átírásához. A diarizálás megkülönbözteti a beszélgetésben részt vevő különböző előadókat. A Speech szolgáltatás információt nyújt arról, hogy melyik beszélő beszélt az átírt beszéd egy bizonyos részén.

Az előadói adatok szerepelnek az eredményben a beszélőazonosító mezőben. A beszélőazonosító egy általános azonosító, amelyet a szolgáltatás minden beszélgetési résztvevőhöz hozzárendel a felismerés során, mivel a megadott hangtartalmak különböző hangszórókat azonosítanak.

Tipp.

A Speech Studióban valós idejű szövegfelolvasást is kipróbálhat anélkül, hogy regisztrálná vagy írná a kódot. A Speech Studio azonban még nem támogatja a diarizálást.

Előfeltételek

  • Azure-előfizetés. Ingyenesen létrehozhat egyet.
  • Speech-erőforrás létrehozása az Azure Portalon.
  • Kérje le a Speech erőforráskulcsát és régióját. A Speech-erőforrás üzembe helyezése után válassza az Ugrás az erőforrásra lehetőséget a kulcsok megtekintéséhez és kezeléséhez.

A környezet beállítása

A környezet beállításához telepítse a Speech SDK-t. A rövid útmutatóban szereplő minta a Java-futtatókörnyezettel működik.

  1. Telepítse az Apache Maven-t. Ezután futtassa mvn -v a sikeres telepítés megerősítéséhez.

  2. Hozzon létre egy új pom.xml fájlt a projekt gyökerében, és másolja be a következőt:

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.microsoft.cognitiveservices.speech.samples</groupId>
        <artifactId>quickstart-eclipse</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <build>
            <sourceDirectory>src</sourceDirectory>
            <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                <source>1.8</source>
                <target>1.8</target>
                </configuration>
            </plugin>
            </plugins>
        </build>
        <dependencies>
            <dependency>
            <groupId>com.microsoft.cognitiveservices.speech</groupId>
            <artifactId>client-sdk</artifactId>
            <version>1.40.0</version>
            </dependency>
        </dependencies>
    </project>
    
  3. Telepítse a Speech SDK-t és a függőségeket.

    mvn clean dependency:copy-dependencies
    

Környezeti változók beállítása

Az Azure AI-szolgáltatások eléréséhez hitelesítenie kell az alkalmazást. Ez a cikk bemutatja, hogyan tárolhatja a hitelesítő adatait környezeti változókkal. Ezután hozzáférhet a környezeti változókhoz a kódból az alkalmazás hitelesítéséhez. Éles környezetben biztonságosabban tárolhatja és érheti el a hitelesítő adatait.

Fontos

Az Azure-erőforrásokhoz tartozó felügyelt identitásokkal rendelkező Microsoft Entra ID-hitelesítést javasoljuk, hogy ne tárolja a hitelesítő adatokat a felhőben futó alkalmazásokkal.

HA API-kulcsot használ, biztonságosan tárolja valahol máshol, például az Azure Key Vaultban. Ne foglalja bele közvetlenül az API-kulcsot a kódba, és soha ne tegye közzé nyilvánosan.

Az AI-szolgáltatások biztonságáról további információt az Azure AI-szolgáltatásokhoz érkező kérelmek hitelesítése című témakörben talál.

A Speech-erőforráskulcs és -régió környezeti változóinak beállításához nyisson meg egy konzolablakot, és kövesse az operációs rendszer és a fejlesztési környezet utasításait.

  • A SPEECH_KEY környezeti változó beállításához cserélje le a kulcsot az erőforrás egyik kulcsára.
  • A SPEECH_REGION környezeti változó beállításához cserélje le a régiót az erőforrás egyik régiójára.
setx SPEECH_KEY your-key
setx SPEECH_REGION your-region

Feljegyzés

Ha csak az aktuális konzolon kell hozzáférnie a környezeti változókhoz, a környezeti változót set ahelyett setxállíthatja be.

A környezeti változók hozzáadása után előfordulhat, hogy újra kell indítania a környezeti változók olvasásához szükséges programokat, beleértve a konzolablakot is. Ha például a Visual Studiót használja szerkesztőként, indítsa újra a Visual Studiót a példa futtatása előtt.

Diarizáció megvalósítása fájlból beszélgetés átírásával

Az alábbi lépéseket követve hozzon létre egy konzolalkalmazást a beszélgetés átírásához.

  1. Hozzon létre egy új fájlt ConversationTranscription.java ugyanabban a projekt gyökérkönyvtárában.

  2. Másolja a következő kódot a következőbe ConversationTranscription.java:

    import com.microsoft.cognitiveservices.speech.*;
    import com.microsoft.cognitiveservices.speech.audio.AudioConfig;
    import com.microsoft.cognitiveservices.speech.transcription.*;
    
    import java.util.concurrent.Semaphore;
    import java.util.concurrent.ExecutionException;
    import java.util.concurrent.Future;
    
    public class ConversationTranscription {
        // This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION"
        private static String speechKey = System.getenv("SPEECH_KEY");
        private static String speechRegion = System.getenv("SPEECH_REGION");
    
        public static void main(String[] args) throws InterruptedException, ExecutionException {
    
            SpeechConfig speechConfig = SpeechConfig.fromSubscription(speechKey, speechRegion);
            speechConfig.setSpeechRecognitionLanguage("en-US");
            AudioConfig audioInput = AudioConfig.fromWavFileInput("katiesteve.wav");
            speechConfig.setProperty(PropertyId.SpeechServiceResponse_DiarizeIntermediateResults, "true");
    
            Semaphore stopRecognitionSemaphore = new Semaphore(0);
    
            ConversationTranscriber conversationTranscriber = new ConversationTranscriber(speechConfig, audioInput);
            {
                // Subscribes to events.
                conversationTranscriber.transcribing.addEventListener((s, e) -> {
                    System.out.println("TRANSCRIBING: Text=" + e.getResult().getText() + " Speaker ID=" + e.getResult().getSpeakerId() );
                });
    
                conversationTranscriber.transcribed.addEventListener((s, e) -> {
                    if (e.getResult().getReason() == ResultReason.RecognizedSpeech) {
                        System.out.println();
                        System.out.println("TRANSCRIBED: Text=" + e.getResult().getText() + " Speaker ID=" + e.getResult().getSpeakerId() );
                        System.out.println();
                    }
                    else if (e.getResult().getReason() == ResultReason.NoMatch) {
                        System.out.println("NOMATCH: Speech could not be transcribed.");
                    }
                });
    
                conversationTranscriber.canceled.addEventListener((s, e) -> {
                    System.out.println("CANCELED: Reason=" + e.getReason());
    
                    if (e.getReason() == CancellationReason.Error) {
                        System.out.println("CANCELED: ErrorCode=" + e.getErrorCode());
                        System.out.println("CANCELED: ErrorDetails=" + e.getErrorDetails());
                        System.out.println("CANCELED: Did you update the subscription info?");
                    }
    
                    stopRecognitionSemaphore.release();
                });
    
                conversationTranscriber.sessionStarted.addEventListener((s, e) -> {
                    System.out.println("\n    Session started event.");
                });
    
                conversationTranscriber.sessionStopped.addEventListener((s, e) -> {
                    System.out.println("\n    Session stopped event.");
                });
    
                conversationTranscriber.startTranscribingAsync().get();
    
                // Waits for completion.
                stopRecognitionSemaphore.acquire();
    
                conversationTranscriber.stopTranscribingAsync().get();
            }
    
            speechConfig.close();
            audioInput.close();
            conversationTranscriber.close();
    
            System.exit(0);
        }
    }
    
  3. Kérje le a minta hangfájlt , vagy használja a saját .wav fájlját. Cserélje le katiesteve.wav a fájl elérési útját és nevét .wav .

    Az alkalmazás felismeri a beszélgetés több résztvevőjének beszédét. A hangfájlnak több hangszórót kell tartalmaznia.

  4. A beszédfelismerés nyelvének módosításához cserélje le en-US egy másik támogatott nyelvre. Például a es-ES spanyol (Spanyolország) esetében. Az alapértelmezett nyelv az en-US , ha nem ad meg nyelvet. A több beszélt nyelv egyikének azonosításáról további információt a nyelvazonosítás című témakörben talál.

  5. Futtassa az új konzolalkalmazást a beszélgetés átírásának elindításához:

    javac ConversationTranscription.java -cp ".;target\dependency\*"
    java -cp ".;target\dependency\*" ConversationTranscription
    

Fontos

Győződjön meg arról, hogy beállítja a környezeti és SPEECH_REGION a SPEECH_KEY környezeti változókat. Ha nem állítja be ezeket a változókat, a minta hibaüzenettel meghiúsul.

Az átírt beszélgetésnek szövegként kell kimenetnek lennie:

TRANSCRIBING: Text=good morning Speaker ID=Unknown
TRANSCRIBING: Text=good morning steve Speaker ID=Unknown
TRANSCRIBING: Text=good morning steve how Speaker ID=Guest-1
TRANSCRIBING: Text=good morning steve how are you doing Speaker ID=Guest-1
TRANSCRIBING: Text=good morning steve how are you doing today Speaker ID=Guest-1

TRANSCRIBED: Text=Good morning, Steve. How are you doing today? Speaker ID=Guest-1

TRANSCRIBING: Text=good morning katie i hope Speaker ID=Guest-2
TRANSCRIBING: Text=good morning katie i hope you're having a Speaker ID=Guest-2
TRANSCRIBING: Text=good morning katie i hope you're having a great Speaker ID=Guest-2
TRANSCRIBING: Text=good morning katie i hope you're having a great start to Speaker ID=Guest-2
TRANSCRIBING: Text=good morning katie i hope you're having a great start to your day Speaker ID=Guest-2

TRANSCRIBED: Text=Good morning, Katie. I hope you're having a great start to your day. Speaker ID=Guest-2

TRANSCRIBING: Text=have you tried Speaker ID=Unknown
TRANSCRIBING: Text=have you tried the latest Speaker ID=Unknown
TRANSCRIBING: Text=have you tried the latest real Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which can Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which can tell you Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which can tell you who said Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which can tell you who said what Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which can tell you who said what in Speaker ID=Guest-1
TRANSCRIBING: Text=have you tried the latest real time diarization in microsoft speech service which can tell you who said what in real time Speaker ID=Guest-1

TRANSCRIBED: Text=Have you tried the latest real time diarization in Microsoft Speech Service which can tell you who said what in real time? Speaker ID=Guest-1

TRANSCRIBING: Text=not yet Speaker ID=Unknown
TRANSCRIBING: Text=not yet i Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch trans Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization function Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces di Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to di Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to diarize in real Speaker ID=Guest-2
TRANSCRIBING: Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to diarize in real time Speaker ID=Guest-2

TRANSCRIBED: Text=Not yet. I've been using the batch transcription with diarization functionality, but it produces diarization results after the whole audio is processed. Is the new feature able to diarize in real time? Speaker ID=Guest-2

TRANSCRIBING: Text=absolutely Speaker ID=Unknown
TRANSCRIBING: Text=absolutely i recom Speaker ID=Guest-1
TRANSCRIBING: Text=absolutely i recommend Speaker ID=Guest-1
TRANSCRIBING: Text=absolutely i recommend you Speaker ID=Guest-1
TRANSCRIBING: Text=absolutely i recommend you give it a try Speaker ID=Guest-1

TRANSCRIBED: Text=Absolutely, I recommend you give it a try. Speaker ID=Guest-1

TRANSCRIBING: Text=that's exc Speaker ID=Unknown
TRANSCRIBING: Text=that's exciting Speaker ID=Unknown
TRANSCRIBING: Text=that's exciting let me try Speaker ID=Guest-2
TRANSCRIBING: Text=that's exciting let me try it right now Speaker ID=Guest-2

TRANSCRIBED: Text=That's exciting. Let me try it right now. Speaker ID=Guest-2

A beszélők a beszélgetésben szereplő előadók számától függően az 1. vendég, a 2. vendég stb. néven vannak azonosítva.

Feljegyzés

A korai köztes eredmények némelyikében megjelenhet Speaker ID=Unknown , ha a beszélő még nincs azonosítva. Köztes diarizálási eredmények nélkül (ha nem állítja be a PropertyId.SpeechServiceResponse_DiarizeIntermediateResults tulajdonságot "true" értékre), a beszélő azonosítója mindig "Ismeretlen".

Az erőforrások eltávolítása

Az Azure Portal vagy az Azure Parancssori felület (CLI) használatával eltávolíthatja a létrehozott Speech-erőforrást.

Referenciadokumentáció csomag (npm) | További minták a GitHub | Library forráskódján |

Ebben a rövid útmutatóban valós idejű diarizálással futtat egy alkalmazást a beszéd és a szöveg átírásához. A diarizálás megkülönbözteti a beszélgetésben részt vevő különböző előadókat. A Speech szolgáltatás információt nyújt arról, hogy melyik beszélő beszélt az átírt beszéd egy bizonyos részén.

Az előadói adatok szerepelnek az eredményben a beszélőazonosító mezőben. A beszélőazonosító egy általános azonosító, amelyet a szolgáltatás minden beszélgetési résztvevőhöz hozzárendel a felismerés során, mivel a megadott hangtartalmak különböző hangszórókat azonosítanak.

Tipp.

A Speech Studióban valós idejű szövegfelolvasást is kipróbálhat anélkül, hogy regisztrálná vagy írná a kódot. A Speech Studio azonban még nem támogatja a diarizálást.

Előfeltételek

  • Azure-előfizetés. Ingyenesen létrehozhat egyet.
  • Speech-erőforrás létrehozása az Azure Portalon.
  • Kérje le a Speech erőforráskulcsát és régióját. A Speech-erőforrás üzembe helyezése után válassza az Ugrás az erőforrásra lehetőséget a kulcsok megtekintéséhez és kezeléséhez.

A környezet beállítása

A környezet beállításához telepítse a JavaScripthez készült Speech SDK-t. Ha csak a csomag nevét szeretné telepíteni, futtassa a parancsot npm install microsoft-cognitiveservices-speech-sdk. Az irányított telepítési utasításokért tekintse meg az SDK telepítési útmutatóját.

Környezeti változók beállítása

Az Azure AI-szolgáltatások eléréséhez hitelesítenie kell az alkalmazást. Ez a cikk bemutatja, hogyan tárolhatja a hitelesítő adatait környezeti változókkal. Ezután hozzáférhet a környezeti változókhoz a kódból az alkalmazás hitelesítéséhez. Éles környezetben biztonságosabban tárolhatja és érheti el a hitelesítő adatait.

Fontos

Az Azure-erőforrásokhoz tartozó felügyelt identitásokkal rendelkező Microsoft Entra ID-hitelesítést javasoljuk, hogy ne tárolja a hitelesítő adatokat a felhőben futó alkalmazásokkal.

HA API-kulcsot használ, biztonságosan tárolja valahol máshol, például az Azure Key Vaultban. Ne foglalja bele közvetlenül az API-kulcsot a kódba, és soha ne tegye közzé nyilvánosan.

Az AI-szolgáltatások biztonságáról további információt az Azure AI-szolgáltatásokhoz érkező kérelmek hitelesítése című témakörben talál.

A Speech-erőforráskulcs és -régió környezeti változóinak beállításához nyisson meg egy konzolablakot, és kövesse az operációs rendszer és a fejlesztési környezet utasításait.

  • A SPEECH_KEY környezeti változó beállításához cserélje le a kulcsot az erőforrás egyik kulcsára.
  • A SPEECH_REGION környezeti változó beállításához cserélje le a régiót az erőforrás egyik régiójára.
setx SPEECH_KEY your-key
setx SPEECH_REGION your-region

Feljegyzés

Ha csak az aktuális konzolon kell hozzáférnie a környezeti változókhoz, a környezeti változót set ahelyett setxállíthatja be.

A környezeti változók hozzáadása után előfordulhat, hogy újra kell indítania a környezeti változók olvasásához szükséges programokat, beleértve a konzolablakot is. Ha például a Visual Studiót használja szerkesztőként, indítsa újra a Visual Studiót a példa futtatása előtt.

Diarizáció megvalósítása fájlból beszélgetés átírásával

Az alábbi lépéseket követve hozzon létre egy új konzolalkalmazást a beszélgetés átírásához.

  1. Nyisson meg egy parancssori ablakot, ahol az új projektet szeretné, és hozzon létre egy új fájlt.ConversationTranscription.js

  2. Telepítse a JavaScripthez készült Speech SDK-t:

    npm install microsoft-cognitiveservices-speech-sdk
    
  3. Másolja a következő kódot a következőbe ConversationTranscription.js:

    const fs = require("fs");
    const sdk = require("microsoft-cognitiveservices-speech-sdk");
    
    // This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION"
    const speechConfig = sdk.SpeechConfig.fromSubscription(process.env.SPEECH_KEY, process.env.SPEECH_REGION);
    
    function fromFile() {
        const filename = "katiesteve.wav";
    
        let audioConfig = sdk.AudioConfig.fromWavFileInput(fs.readFileSync(filename));
        let conversationTranscriber = new sdk.ConversationTranscriber(speechConfig, audioConfig);
    
        var pushStream = sdk.AudioInputStream.createPushStream();
    
        fs.createReadStream(filename).on('data', function(arrayBuffer) {
            pushStream.write(arrayBuffer.slice());
        }).on('end', function() {
            pushStream.close();
        });
    
        console.log("Transcribing from: " + filename);
    
        conversationTranscriber.sessionStarted = function(s, e) {
            console.log("SessionStarted event");
            console.log("SessionId:" + e.sessionId);
        };
        conversationTranscriber.sessionStopped = function(s, e) {
            console.log("SessionStopped event");
            console.log("SessionId:" + e.sessionId);
            conversationTranscriber.stopTranscribingAsync();
        };
        conversationTranscriber.canceled = function(s, e) {
            console.log("Canceled event");
            console.log(e.errorDetails);
            conversationTranscriber.stopTranscribingAsync();
        };
        conversationTranscriber.transcribed = function(s, e) {
            console.log("TRANSCRIBED: Text=" + e.result.text + " Speaker ID=" + e.result.speakerId);
        };
    
        // Start conversation transcription
        conversationTranscriber.startTranscribingAsync(
            function () {},
            function (err) {
                console.trace("err - starting transcription: " + err);
            }
        );
    
    }
    fromFile();
    
  4. Kérje le a minta hangfájlt , vagy használja a saját .wav fájlját. Cserélje le katiesteve.wav a fájl elérési útját és nevét .wav .

    Az alkalmazás felismeri a beszélgetés több résztvevőjének beszédét. A hangfájlnak több hangszórót kell tartalmaznia.

  5. A beszédfelismerés nyelvének módosításához cserélje le en-US egy másik támogatott nyelvre. Például a es-ES spanyol (Spanyolország) esetében. Az alapértelmezett nyelv az en-US , ha nem ad meg nyelvet. A több beszélt nyelv egyikének azonosításáról további információt a nyelvazonosítás című témakörben talál.

  6. Futtassa az új konzolalkalmazást a beszédfelismerés fájlból való elindításához:

    node.exe ConversationTranscription.js
    

Fontos

Győződjön meg arról, hogy beállítja a környezeti és SPEECH_REGION a SPEECH_KEY környezeti változókat. Ha nem állítja be ezeket a változókat, a minta hibaüzenettel meghiúsul.

Az átírt beszélgetésnek szövegként kell kimenetnek lennie:

SessionStarted event
SessionId:E87AFBA483C2481985F6C9AF719F616B
TRANSCRIBED: Text=Good morning, Steve. Speaker ID=Unknown
TRANSCRIBED: Text=Good morning, Katie. Speaker ID=Unknown
TRANSCRIBED: Text=Have you tried the latest real time diarization in Microsoft Speech Service which can tell you who said what in real time? Speaker ID=Guest-1
TRANSCRIBED: Text=Not yet. I've been using the batch transcription with diarization functionality, but it produces diarization result until whole audio get processed. Speaker ID=Guest-2
TRANSCRIBED: Text=Is the new feature can diarize in real time? Speaker ID=Guest-2
TRANSCRIBED: Text=Absolutely. Speaker ID=Guest-1
TRANSCRIBED: Text=That's exciting. Let me try it right now. Speaker ID=Guest-2
Canceled event
undefined
SessionStopped event
SessionId:E87AFBA483C2481985F6C9AF719F616B

A beszélők a beszélgetésben szereplő előadók számától függően az 1. vendég, a 2. vendég stb. néven vannak azonosítva.

Az erőforrások eltávolítása

Az Azure Portal vagy az Azure Parancssori felület (CLI) használatával eltávolíthatja a létrehozott Speech-erőforrást.

Referenciadokumentáció csomag (letöltés) | További minták a GitHubon |

A Speech SDK for Objective-C támogatja a beszélgetés átírását, de még nem tartalmaztunk útmutatót. Válasszon egy másik programozási nyelvet az első lépésekhez, és ismerje meg a fogalmakat, vagy tekintse meg a cikk elején hivatkozott Objective-C referenciát és mintákat.

Referenciadokumentáció csomag (letöltés) | További minták a GitHubon |

A Speech SDK for Swift támogatja a beszélgetés átírását, de itt még nem tartalmaztunk útmutatót. Válasszon egy másik programozási nyelvet az első lépésekhez, és ismerje meg a fogalmakat, vagy tekintse meg a swift-hivatkozást és a cikk elején hivatkozott mintákat.

Referenciadokumentáció csomag (PyPi) | További minták a GitHubon |

Ebben a rövid útmutatóban valós idejű diarizálással futtat egy alkalmazást a beszéd és a szöveg átírásához. A diarizálás megkülönbözteti a beszélgetésben részt vevő különböző előadókat. A Speech szolgáltatás információt nyújt arról, hogy melyik beszélő beszélt az átírt beszéd egy bizonyos részén.

Az előadói adatok szerepelnek az eredményben a beszélőazonosító mezőben. A beszélőazonosító egy általános azonosító, amelyet a szolgáltatás minden beszélgetési résztvevőhöz hozzárendel a felismerés során, mivel a megadott hangtartalmak különböző hangszórókat azonosítanak.

Tipp.

A Speech Studióban valós idejű szövegfelolvasást is kipróbálhat anélkül, hogy regisztrálná vagy írná a kódot. A Speech Studio azonban még nem támogatja a diarizálást.

Előfeltételek

  • Azure-előfizetés. Ingyenesen létrehozhat egyet.
  • Speech-erőforrás létrehozása az Azure Portalon.
  • Kérje le a Speech erőforráskulcsát és régióját. A Speech-erőforrás üzembe helyezése után válassza az Ugrás az erőforrásra lehetőséget a kulcsok megtekintéséhez és kezeléséhez.

A környezet beállítása

A PythonHoz készült Speech SDK Python-csomagindex (PyPI) modulként érhető el. A PythonHoz készült Speech SDK kompatibilis a Windows, a Linux és a macOS rendszerrel.

Telepítse a Python 3.7-es vagy újabb verzióját. Először tekintse meg az SDK telepítési útmutatóját a további követelményekért.

Környezeti változók beállítása

Az Azure AI-szolgáltatások eléréséhez hitelesítenie kell az alkalmazást. Ez a cikk bemutatja, hogyan tárolhatja a hitelesítő adatait környezeti változókkal. Ezután hozzáférhet a környezeti változókhoz a kódból az alkalmazás hitelesítéséhez. Éles környezetben biztonságosabban tárolhatja és érheti el a hitelesítő adatait.

Fontos

Az Azure-erőforrásokhoz tartozó felügyelt identitásokkal rendelkező Microsoft Entra ID-hitelesítést javasoljuk, hogy ne tárolja a hitelesítő adatokat a felhőben futó alkalmazásokkal.

HA API-kulcsot használ, biztonságosan tárolja valahol máshol, például az Azure Key Vaultban. Ne foglalja bele közvetlenül az API-kulcsot a kódba, és soha ne tegye közzé nyilvánosan.

Az AI-szolgáltatások biztonságáról további információt az Azure AI-szolgáltatásokhoz érkező kérelmek hitelesítése című témakörben talál.

A Speech-erőforráskulcs és -régió környezeti változóinak beállításához nyisson meg egy konzolablakot, és kövesse az operációs rendszer és a fejlesztési környezet utasításait.

  • A SPEECH_KEY környezeti változó beállításához cserélje le a kulcsot az erőforrás egyik kulcsára.
  • A SPEECH_REGION környezeti változó beállításához cserélje le a régiót az erőforrás egyik régiójára.
setx SPEECH_KEY your-key
setx SPEECH_REGION your-region

Feljegyzés

Ha csak az aktuális konzolon kell hozzáférnie a környezeti változókhoz, a környezeti változót set ahelyett setxállíthatja be.

A környezeti változók hozzáadása után előfordulhat, hogy újra kell indítania a környezeti változók olvasásához szükséges programokat, beleértve a konzolablakot is. Ha például a Visual Studiót használja szerkesztőként, indítsa újra a Visual Studiót a példa futtatása előtt.

Diarizáció megvalósítása fájlból beszélgetés átírásával

Kövesse az alábbi lépéseket egy új konzolalkalmazás létrehozásához.

  1. Nyisson meg egy parancssori ablakot, ahol az új projektet szeretné, és hozzon létre egy új fájlt.conversation_transcription.py

  2. Futtassa ezt a parancsot a Speech SDK telepítéséhez:

    pip install azure-cognitiveservices-speech
    
  3. Másolja a következő kódot a következőbe conversation_transcription.py:

    import os
    import time
    import azure.cognitiveservices.speech as speechsdk
    
    def conversation_transcriber_recognition_canceled_cb(evt: speechsdk.SessionEventArgs):
        print('Canceled event')
    
    def conversation_transcriber_session_stopped_cb(evt: speechsdk.SessionEventArgs):
        print('SessionStopped event')
    
    def conversation_transcriber_transcribed_cb(evt: speechsdk.SpeechRecognitionEventArgs):
        print('\nTRANSCRIBED:')
        if evt.result.reason == speechsdk.ResultReason.RecognizedSpeech:
            print('\tText={}'.format(evt.result.text))
            print('\tSpeaker ID={}\n'.format(evt.result.speaker_id))
        elif evt.result.reason == speechsdk.ResultReason.NoMatch:
            print('\tNOMATCH: Speech could not be TRANSCRIBED: {}'.format(evt.result.no_match_details))
    
    def conversation_transcriber_transcribing_cb(evt: speechsdk.SpeechRecognitionEventArgs):
        print('TRANSCRIBING:')
        print('\tText={}'.format(evt.result.text))
        print('\tSpeaker ID={}'.format(evt.result.speaker_id))
    
    def conversation_transcriber_session_started_cb(evt: speechsdk.SessionEventArgs):
        print('SessionStarted event')
    
    def recognize_from_file():
        # This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION"
        speech_config = speechsdk.SpeechConfig(subscription=os.environ.get('SPEECH_KEY'), region=os.environ.get('SPEECH_REGION'))
        speech_config.speech_recognition_language="en-US"
        speech_config.set_property(property_id=speechsdk.PropertyId.SpeechServiceResponse_DiarizeIntermediateResults, value='true')
    
        audio_config = speechsdk.audio.AudioConfig(filename="katiesteve.wav")
        conversation_transcriber = speechsdk.transcription.ConversationTranscriber(speech_config=speech_config, audio_config=audio_config)
    
        transcribing_stop = False
    
        def stop_cb(evt: speechsdk.SessionEventArgs):
            #"""callback that signals to stop continuous recognition upon receiving an event `evt`"""
            print('CLOSING on {}'.format(evt))
            nonlocal transcribing_stop
            transcribing_stop = True
    
        # Connect callbacks to the events fired by the conversation transcriber
        conversation_transcriber.transcribed.connect(conversation_transcriber_transcribed_cb)
        conversation_transcriber.transcribing.connect(conversation_transcriber_transcribing_cb)
        conversation_transcriber.session_started.connect(conversation_transcriber_session_started_cb)
        conversation_transcriber.session_stopped.connect(conversation_transcriber_session_stopped_cb)
        conversation_transcriber.canceled.connect(conversation_transcriber_recognition_canceled_cb)
        # stop transcribing on either session stopped or canceled events
        conversation_transcriber.session_stopped.connect(stop_cb)
        conversation_transcriber.canceled.connect(stop_cb)
    
        conversation_transcriber.start_transcribing_async()
    
        # Waits for completion.
        while not transcribing_stop:
            time.sleep(.5)
    
        conversation_transcriber.stop_transcribing_async()
    
    # Main
    
    try:
        recognize_from_file()
    except Exception as err:
        print("Encountered exception. {}".format(err))
    
  4. Kérje le a minta hangfájlt , vagy használja a saját .wav fájlját. Cserélje le katiesteve.wav a fájl elérési útját és nevét .wav .

    Az alkalmazás felismeri a beszélgetés több résztvevőjének beszédét. A hangfájlnak több hangszórót kell tartalmaznia.

  5. A beszédfelismerés nyelvének módosításához cserélje le en-US egy másik támogatott nyelvre. Például a es-ES spanyol (Spanyolország) esetében. Az alapértelmezett nyelv az en-US , ha nem ad meg nyelvet. A több beszélt nyelv egyikének azonosításáról további információt a nyelvazonosítás című témakörben talál.

  6. Futtassa az új konzolalkalmazást a beszélgetés átírásának elindításához:

    python conversation_transcription.py
    

Fontos

Győződjön meg arról, hogy beállítja a környezeti és SPEECH_REGION a SPEECH_KEY környezeti változókat. Ha nem állítja be ezeket a változókat, a minta hibaüzenettel meghiúsul.

Az átírt beszélgetésnek szövegként kell kimenetnek lennie:

TRANSCRIBING:
        Text=good morning
        Speaker ID=Unknown
TRANSCRIBING:
        Text=good morning steve
        Speaker ID=Unknown
TRANSCRIBING:
        Text=good morning steve how are
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=good morning steve how are you doing today
        Speaker ID=Guest-1

TRANSCRIBED:
        Text=Good morning, Steve. How are you doing today?
        Speaker ID=Guest-1

TRANSCRIBING:
        Text=good morning katie
        Speaker ID=Unknown
TRANSCRIBING:
        Text=good morning katie i hope you're having a
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=good morning katie i hope you're having a great start to
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=good morning katie i hope you're having a great start to your day
        Speaker ID=Guest-2

TRANSCRIBED:
        Text=Good morning, Katie. I hope you're having a great start to your day.
        Speaker ID=Guest-2

TRANSCRIBING:
        Text=have you
        Speaker ID=Unknown
TRANSCRIBING:
        Text=have you tried
        Speaker ID=Unknown
TRANSCRIBING:
        Text=have you tried the latest
        Speaker ID=Unknown
TRANSCRIBING:
        Text=have you tried the latest real
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time diarization
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time diarization in
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time diarization in microsoft
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time diarization in microsoft speech
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time diarization in microsoft speech service
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time diarization in microsoft speech service which
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time diarization in microsoft speech service which can
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time diarization in microsoft speech service which can tell you
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time diarization in microsoft speech service which can tell you who said        
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time diarization in microsoft speech service which can tell you who said what   
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time diarization in microsoft speech service which can tell you who said what in
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=have you tried the latest real time diarization in microsoft speech service which can tell you who said what in real time
        Speaker ID=Guest-1

TRANSCRIBED:
        Text=Have you tried the latest real time diarization in Microsoft Speech Service which can tell you who said what in real time?
        Speaker ID=Guest-1

TRANSCRIBING:
        Text=not yet
        Speaker ID=Unknown
TRANSCRIBING:
        Text=not yet i
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch trans
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization function
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces di
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization     
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to di
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to diarize in real
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=not yet i've been using the batch transcription with diarization functionality but it produces diarization results after the whole audio is processed is the new feature able to diarize in real time
        Speaker ID=Guest-2

TRANSCRIBED:
        Text=Not yet. I've been using the batch transcription with diarization functionality, but it produces diarization results after the whole audio is processed. Is the new feature able to diarize in real time?
        Speaker ID=Guest-2

TRANSCRIBING:
        Text=absolutely
        Speaker ID=Unknown
TRANSCRIBING:
        Text=absolutely i
        Speaker ID=Unknown
TRANSCRIBING:
        Text=absolutely i recom
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=absolutely i recommend
        Speaker ID=Guest-1
TRANSCRIBING:
        Text=absolutely i recommend you give it a try
        Speaker ID=Guest-1

TRANSCRIBED:
        Text=Absolutely, I recommend you give it a try.
        Speaker ID=Guest-1

TRANSCRIBING:
        Text=that's exc
        Speaker ID=Unknown
TRANSCRIBING:
        Text=that's exciting
        Speaker ID=Unknown
TRANSCRIBING:
        Text=that's exciting let me
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=that's exciting let me try
        Speaker ID=Guest-2
TRANSCRIBING:
        Text=that's exciting let me try it right now
        Speaker ID=Guest-2

TRANSCRIBED:
        Text=That's exciting. Let me try it right now.
        Speaker ID=Guest-2

A beszélők a beszélgetésben szereplő előadók számától függően az 1. vendég, a 2. vendég stb. néven vannak azonosítva.

Feljegyzés

A korai köztes eredmények némelyikében megjelenhet Speaker ID=Unknown , ha a beszélő még nincs azonosítva. Köztes diarizálási eredmények nélkül (ha nem állítja be a PropertyId.SpeechServiceResponse_DiarizeIntermediateResults tulajdonságot "true" értékre), a beszélő azonosítója mindig "Ismeretlen".

Az erőforrások eltávolítása

Az Azure Portal vagy az Azure Parancssori felület (CLI) használatával eltávolíthatja a létrehozott Speech-erőforrást.

Speech to text REST API reference | Speech to text REST API for short audio reference | További minták a GitHubon

A REST API nem támogatja a beszélgetések átírását. Válasszon másik programozási nyelvet vagy eszközt a lap tetején.

A Speech CLI nem támogatja a beszélgetés átírását. Válasszon másik programozási nyelvet vagy eszközt a lap tetején.

Következő lépés