關於語音 SDKAbout the Speech SDK

語音軟體開發套件 (SDK) 可讓您的應用程式存取權的函式語音服務,讓您更輕鬆地開發具備語音功能的軟體。The Speech Software Development Kit (SDK) gives your applications access to the functions of the Speech Services, making it easier to develop speech-enabled software. 目前,Sdk 會提供存取權語音轉換文字文字轉換語音語音翻譯意圖辨識,及Bot Framework 直接列語音通道Currently, the SDKs provide access to speech-to-text, text-to-speech, speech translation, intent recognition, and Bot Framework’s Direct Line Speech channel. 可以找到之功能和支援的平台相關的一般概觀,文件上項目頁面A general overview about the capabilities and supported platforms can be found on the documentation entry page.

程式設計語言Programming language 平台Platform API 參考資料API reference
C/C++C/C++ Windows、Linux、macOSWindows, Linux, macOS BrowseBrowse
C#C# Windows、UWP、.NET Framework (Windows)、.NET Core、UnityWindows, UWP, .NET Framework (Windows), .NET Core, Unity BrowseBrowse
JavaJava Android、 Windows、 Linux、 macOSAndroid, Windows, Linux, macOS BrowseBrowse
JAVA*Java* 語音裝置 SDKSpeech Devices SDK BrowseBrowse
JavaScript/Node.jsJavaScript/Node.js Browser、Windows、Linux、macOSBrowser, Windows, Linux, macOS BrowseBrowse
Objective-CObjective-C iOS、macOSiOS, macOS BrowseBrowse
PythonPython Windows、Linux、macOSWindows, Linux, macOS BrowseBrowse

* Java SDK 也可作為語音裝置 SDK 的一部分。* The Java SDK is also available as part of the Speech Devices SDK.

重要

下載此頁面上的任何「Azure 認知服務的語音 SDK」元件,即表示您知悉其授權。By downloading any of the Speech SDK for Azure Cognitive Services components on this page, you acknowledge its license. 請參閱語音 SDK 的 Microsoft 軟體授權條款See the Microsoft Software License Terms for the Speech SDK.

取得 SDKGet the SDK

視窗Windows

針對 Windows,我們支援下列語言:For Windows, we support the following languages:

  • C# (UWP 與 .NET),C++:您可以參考並使用語音 SDK NuGet 套件的最新版本。C# (UWP and .NET), C++: You can reference and use the latest version of our Speech SDK NuGet package. 此套件包括 32 位元和 64 位元的用戶端程式庫,以及受控 (.NET) 程式庫。The package includes 32-bit and 64-bit client libraries and managed (.NET) libraries. 使用 NuGet 即可在 Visual Studio 中安裝此 SDK。The SDK can be installed in Visual Studio by using NuGet. 請搜尋 Microsoft.CognitiveServices.SpeechSearch for Microsoft.CognitiveServices.Speech.

  • Java:您可以參考並使用我們的最新版「語音 SDK」Maven 套件,此版本只支援 Windows x64。Java: You can reference and use the latest version of our Speech SDK Maven package, which supports only Windows x64. 在您的 Maven 專案中,新增 https://csspeechstorage.blob.core.windows.net/maven/ 作為額外的存放庫,並參考 com.microsoft.cognitiveservices.speech:client-sdk:1.6.0 作為相依性。In your Maven project, add https://csspeechstorage.blob.core.windows.net/maven/ as an additional repository and reference com.microsoft.cognitiveservices.speech:client-sdk:1.6.0 as a dependency.

LinuxLinux

注意

目前的電腦上支援 Ubuntu 16.04,Ubuntu 18.04 和 Debian 9 (x86 或 x64 的C++開發和.NET Core、 Java 和 Python 的 x64)。Currently, we support only Ubuntu 16.04, Ubuntu 18.04, and Debian 9 on a PC (x86 or x64 for C++ development and x64 for .NET Core, Java, and Python).

請確定您具有執行下列 shell 命令來安裝必要的程式庫:Make sure you have the required libraries installed by running the following shell commands:

在 Ubuntu 上:On Ubuntu:

sudo apt-get update
sudo apt-get install libssl1.0.0 libasound2

在 Debian 9 上:On Debian 9:

sudo apt-get update
sudo apt-get install libssl1.0.2 libasound2
  • C#: 您可以參考並使用語音 SDK NuGet 套件的最新版本。C#: You can reference and use the latest version of our Speech SDK NuGet package. 若要參考 SDK,請在專案中新增下列套件參考:To reference the SDK, add the following package reference to your project:

    <PackageReference Include="Microsoft.CognitiveServices.Speech" Version="1.6.0" />
    
  • Java:您可以參考並使用語音 SDK Maven 套件的最新版本。Java: You can reference and use the latest version of our Speech SDK Maven package. 在您的 Maven 專案中,新增 https://csspeechstorage.blob.core.windows.net/maven/ 作為額外的存放庫,並參考 com.microsoft.cognitiveservices.speech:client-sdk:1.6.0 作為相依性。In your Maven project, add https://csspeechstorage.blob.core.windows.net/maven/ as an additional repository and reference com.microsoft.cognitiveservices.speech:client-sdk:1.6.0 as a dependency.

  • C++:將 SDK 下載為 .tar 套件,然後將檔案解壓縮至您選擇的目錄。C++: Download the SDK as a .tar package and unpack the files in a directory of your choice. 下表顯示 SDK 資料夾結構:The following table shows the SDK folder structure:

    PathPath 描述Description
    license.md 使用權License
    ThirdPartyNotices.md 協力廠商通知Third-party notices
    include C 和 C++ 的標頭檔Header files for C and C++
    lib/x64 與應用程式連結的原生 x64 程式庫Native x64 library for linking with your application
    lib/x86 與應用程式連結的原生 x86 程式庫Native x86 library for linking with your application

    若要建立應用程式,請將所需的二進位檔 (和程式庫) 複製或移至您的開發環境。To create an application, copy or move the required binaries (and libraries) into your development environment. 視需要將它們包含在您的建置程序中。Include them as required in your build process.

AndroidAndroid

適用於 Android 的 Java SDK 會封裝成 AAR (Android 程式庫) (英文),其中包含必要的程式庫及所需的 Android 權限。The Java SDK for Android is packaged as an AAR (Android Library), which includes the necessary libraries and required Android permissions. 它會以 com.microsoft.cognitiveservices.speech:client-sdk:1.6.0 套件的形式裝載在位於 https://csspeechstorage.blob.core.windows.net/maven/ 的 Maven 存放庫中。It's hosted in a Maven repository at https://csspeechstorage.blob.core.windows.net/maven/ as package com.microsoft.cognitiveservices.speech:client-sdk:1.6.0.

若要從 Android Studio 專案取用套件,請進行下列變更:To consume the package from your Android Studio project, make the following changes:

  • 在專案層級的 build.gradle 檔案中,將下列內容新增至 repository 區段:In the project-level build.gradle file, add the following to the repository section:

    maven { url 'https://csspeechstorage.blob.core.windows.net/maven/' }
    
  • 在模組層級的 build.gradle 檔案中,將下列內容新增至 dependencies 區段:In the module-level build.gradle file, add the following to the dependencies section:

    implementation 'com.microsoft.cognitiveservices.speech:client-sdk:1.6.0'
    

Java SDK 也是語音裝置 SDK 的一部分。The Java SDK is also part of the Speech Devices SDK.

取得範例Get the samples

如需最新的範例,請參閱 GitHub 上的認知服務語音 SDK 範例程式碼存放庫For the latest samples, see the Cognitive Services Speech SDK sample code repository on GitHub.

後續步驟Next steps