3.新增 Azure 認知服務語音翻譯元件3. Adding the Azure Cognitive Services speech translation component

在本教學課程中,您會將語音翻譯新增至您的專案,以讓您將語音翻譯及轉譯成三種不同語言。In this tutorial, you will add speech translation to your project which will allow you to translate and transcribed your speech into three different languages.

目標Objectives

  • 了解如何整合 Azure 語音翻譯Learn how to integrate Azure speech translation

指示Instructions

在 [階層] 視窗中選取 Lunarcom 物件,然後在 [偵測器] 視窗中使用 [新增元件] 按鈕來將 Lunarcom Translation Recognizer (指令碼) 元件新增至 Lunarcom 物件,並進行以下設定:In the Hierarchy window, select the Lunarcom object, then in the Inspector window, use the Add Component button to add the Lunarcom Translation Recognizer (Script) component to the Lunarcom object and configure it as follows:

  • 將 [目標語言] 變更為您選擇的語言,例如:德文 Change the Target Language to a language of your choosing, for example, German

mrlearning-speech

注意

Lunarcom Translation Recognizer (指令碼) 元件不是 MRTK 的一部分。The Lunarcom Translation Recognizer (Script) component is not part of MRTK. 這是本教學課程資產隨附的元件。It was provided with this tutorial's assets.

如果您現在進入遊戲模式,您可以先按下衛星按鈕來測試語音翻譯。If you now enter Game mode, you can test the speech translation by first pressing the satellite button. 接下來,假設您的電腦有麥克風,當您說到某個項目時,您的語音會翻譯成您選擇的語言並在終端機面板上進行轉譯:Then, assuming your computer has a microphone, when you say something, your speech will be translated into the chosen language and transcribed on the terminal panel:

mrlearning-speech

警告

應用程式必須連線到 Azure,因此請確定您的電腦/裝置已連線到網際網路。The application needs to connect to Azure, so make sure your computer/device is connected to the internet.

恭喜!Congratulations

您的專案現在可以成功地將您所說的字詞轉譯成數種不同的語言。Your project can now successfully translate the words you speak into several different languages. 在您的裝置上執行應用程式,以確保功能可正常運作。Run the application on your device to ensure the feature is working properly.