クイック スタート:開発環境を設定するQuickstart: Setup development environment
ターゲット環境を選択してくださいChoose your target environment
このガイドでは、.NET Framework (Windows) 用の Speech SDK をインストールする方法について説明します。This guide shows how to install the Speech SDK for .NET Framework (Windows). このパッケージ名の使用を自分で開始する場合は、NuGet コンソールで Install-Package Microsoft.CognitiveServices.Speech
を実行します。If you just want the package name to get started on your own, run Install-Package Microsoft.CognitiveServices.Speech
in the NuGet console.
重要
Azure Cognitive Services Speech SDK のいずれかをダウンロードした時点で、同 SDK のライセンス条件に同意したものと見なされます。By downloading any of the Azure Cognitive Services Speech SDKs, you acknowledge its license. 詳細については、次を参照してください。For more information, see:
前提条件Prerequisites
このクイック スタートでは以下が必要です。This quickstart requires:
- Windows では、お使いのプラットフォームに対応した Microsoft Visual Studio 2019 の Visual C++ 再頒布可能パッケージが必要です。On Windows, you need the Microsoft Visual C++ Redistributable for Visual Studio 2019 for your platform. これを初めてインストールする場合、再起動が必要になる場合があります。Installing this for the first time may require a restart.
- Visual Studio 2019Visual Studio 2019
Visual Studio プロジェクトを作成して Speech SDK をインストールするCreate a Visual Studio project and install the Speech SDK
Speech SDK NuGet パッケージをインストールして、コード内で参照できるようにする必要があります。You'll need to install the Speech SDK NuGet package so you can reference it in your code. そのためには、必要に応じて最初に helloworld プロジェクトを作成します。To do that, you may first need to create a helloworld project. .NET デスクトップ開発 ワークロードを使用できるプロジェクトが既にある場合は、そのプロジェクトを使用し、「NuGet パッケージ マネージャーを使用して Speech SDK をインストールする」に進んでください。If you already have a project with the .NET desktop development workload available, you can use that project and skip to Use NuGet Package Manager to install the Speech SDK.
helloworld プロジェクトを作成するCreate helloworld project
Visual Studio 2019 を開きます。Open Visual Studio 2019.
[開始] ウィンドウで、 [新しいプロジェクトの作成] を選択します。In the Start window, select Create a new project.
[新しいプロジェクトの作成] ウィンドウで、[コンソール アプリ (.NET Framework)] を選択してから、[次へ] を選択します。In the Create a new project window, choose Console App (.NET Framework), and then select Next.
[新しいプロジェクトの構成] ウィンドウの [プロジェクト名] に「helloworld」と入力し、保存先 となるディレクトリのパスを選択するか作成して、[作成] を選択します。In the Configure your new project window, enter helloworld in Project name, choose or create the directory path in Location, and then select Create.
Visual Studio のメニュー バーから、 [ツール] > [ツールと機能を取得] の順に選択して Visual Studio インストーラーを開き、 [変更中] ダイアログ ボックスを表示します。From the Visual Studio menu bar, select Tools > Get Tools and Features, which opens Visual Studio Installer and displays the Modifying dialog box.
[.NET デスクトップ開発] ワークロードが利用できるかどうかを確認します。Check whether the .NET desktop development workload is available. このワークロードがまだインストールされていない場合は、その横にあるチェック ボックスをオンにし、[変更] を選択してインストールを開始してください。If the workload hasn't been installed, select the check box next to it, and then select Modify to start the installation. ダウンロードとインストールに数分かかる場合があります。It may take a few minutes to download and install.
[.NET デスクトップ開発] の横のチェック ボックスが既にオンになっている場合は、[閉じる] を選択してダイアログ ボックスを終了します。If the check box next to .NET desktop development is already selected, select Close to exit the dialog box.
Visual Studio インストーラーを閉じます。Close Visual Studio Installer.
NuGet パッケージ マネージャーを使用して Speech SDK をインストールするUse NuGet Package Manager to install the Speech SDK
ソリューション エクスプローラーで helloworld プロジェクトを右クリックし、 [NuGet パッケージの管理] を選択して NuGet パッケージ マネージャーを表示します。In the Solution Explorer, right-click the helloworld project, and then select Manage NuGet Packages to show the NuGet Package Manager.
右上隅で [パッケージ ソース] ドロップダウン ボックスを探し、 [
nuget.org
] が選択されていることを確認します。In the upper-right corner, find the Package Source drop-down box, and make sure thatnuget.org
is selected.左上隅で [参照] を選択します。In the upper-left corner, select Browse.
検索ボックスに「Microsoft.CognitiveServices.Speech」と入力し、Enter キーを押します。In the search box, type Microsoft.CognitiveServices.Speech and select Enter.
検索結果から [Microsoft.CognitiveServices.Speech] パッケージを選択し、[インストール] を選択して最新の安定バージョンをインストールします。From the search results, select the Microsoft.CognitiveServices.Speech package, and then select Install to install the latest stable version.
すべての契約とライセンスに同意して、インストールを開始します。Accept all agreements and licenses to start the installation.
パッケージがインストールされると、 [パッケージマネージャー コンソール] ウィンドウに確認が表示されます。After the package is installed, a confirmation appears in the Package Manager Console window.
ターゲット アーキテクチャを選択するChoose target architecture
コンソール アプリケーションをビルドして実行するには、お使いのコンピューターのアーキテクチャに合ったプラットフォーム構成を作成します。To build and run the console application, create a platform configuration matching your computer's architecture.
メニュー バーから、 [ビルド] 、 [構成マネージャー] の順に選択します。From the menu bar, select Build > Configuration Manager. [構成マネージャー] ダイアログ ボックスが表示されます。The Configuration Manager dialog box appears.
[アクティブ ソリューション プラットフォーム] ドロップダウン ボックスで [新規] を選択します。In the Active solution platform drop-down box, select New. [新しいソリューション プラットフォーム] ダイアログ ボックスが表示されます。The New Solution Platform dialog box appears.
[新しいプラットフォームを入力または選択してください] ドロップダウン ボックスで:In the Type or select the new platform drop-down box:
- 64 ビット Windows を実行している場合、x64 を選択します。If you're running 64-bit Windows, select x64.
- 32 ビット Windows を実行している場合、x86 を選択します。If you're running 32-bit Windows, select x86.
[OK]、[閉じる] の順に選択します。Select OK and then Close.
次のステップNext steps
- クイック スタート: マイクから音声を認識するQuickstart: Recognize speech from a microphone
- クイック スタート: ファイルから音声を認識するQuickstart: Recognize speech from a file
- クイックスタート: Azure BLOB から音声を認識するQuickstart: Recognize speech from an Azure Blob
- クイック スタート:音声テキスト変換の翻訳Quickstart: Translate speech-to-text
- クイックスタート: テキストをオーディオ デバイスに合成するQuickstart: Synthesize text to an audio device
- クイックスタート: テキストをファイルに合成するQuickstart: Synthesize text to a file
- クイックスタート: 意図を認識するQuickstart: Recognize Intents
ターゲット環境を選択してくださいChoose your target environment
このガイドでは、Linux 用 Speech SDK をインストールする方法について説明しますThis guide shows how to install the Speech SDK for Linux
重要
Azure Cognitive Services Speech SDK のいずれかをダウンロードした時点で、同 SDK のライセンス条件に同意したものと見なされます。By downloading any of the Azure Cognitive Services Speech SDKs, you acknowledge its license. 詳細については、次を参照してください。For more information, see:
システム要件System requirements
Linux。サポートされている Linux ディストリビューションとターゲット アーキテクチャの一覧を参照してください。Linux; see the list of supported Linux distributions and target architectures.
前提条件Prerequisites
このクイックスタートを完了するには、次のものが必要です。To complete this quickstart, you'll need:
サポートされている Linux プラットフォームでは、特定のライブラリがインストールされている必要があります (Secure Sockets Layer サポート用に
libssl
、サウンド サポート用にlibasound2
)。Supported Linux platforms will require certain libraries installed (libssl
for secure sockets layer support andlibasound2
for sound support). これらのライブラリの正しいバージョンをインストールするために必要なコマンドについては、下記のディストリビューションを参照してください。Refer to your distribution below for the commands needed to install the correct versions of these libraries.Ubuntu/Debian の場合:On Ubuntu/Debian:
sudo apt-get update sudo apt-get install build-essential libssl1.0.0 libasound2 wget
libssl1.0.0 が使用できない場合は、libssl1.0.x (ここで、x は 0 より大) または libssl1.1 を代わりにインストールします。If libssl1.0.0 is not available, install libssl1.0.x (where x is greater than 0) or libssl1.1 instead.
RHEL または CentOS の場合:On RHEL/CentOS:
sudo yum update sudo yum groupinstall "Development tools" sudo yum install alsa-lib openssl wget
注意
- RHEL または CentOS 7 の場合、「Speech SDK 用に RHEL/CentOS 7 を構成する」の手順に従います。On RHEL/CentOS 7, follow the instructions on how to configure RHEL/CentOS 7 for Speech SDK.
- RHEL または CentOS 8 の場合、「Linux 用 OpenSSL の構成」の手順に従います。On RHEL/CentOS 8, follow the instructions on how to configure OpenSSL for Linux.
Speech SDK をインストールするInstall Speech SDK
Linux 用 Speech SDK は、64 ビット アプリケーションと 32 ビット アプリケーションのどちらの構築にも使用できます。The Speech SDK for Linux can be used to build both 64-bit and 32-bit applications. 必要なライブラリとヘッダー ファイルは、https://aka.ms/csspeech/linuxbinary から tar ファイルとしてダウンロードできます。The required libraries and header files can be downloaded as a tar file from https://aka.ms/csspeech/linuxbinary.
SDK を次のようにダウンロードしてインストールします。Download and install the SDK as follows:
Speech SDK のファイル抽出先にする必要があるディレクトリを選択し、そのディレクトリを指すように
SPEECHSDK_ROOT
環境変数を設定します。Choose a directory to which the Speech SDK files should be extracted, and set theSPEECHSDK_ROOT
environment variable to point to that directory. この変数によって、後のコマンドでこのディレクトリを参照することが容易になります。This variable makes it easy to refer to the directory in future commands. たとえば、ホーム ディレクトリでspeechsdk
ディレクトリを使用する場合、次のようなコマンドを使用します。For example, if you want to use the directoryspeechsdk
in your home directory, use a command like the following:export SPEECHSDK_ROOT="$HOME/speechsdk"
このディレクトリがまだ存在しない場合は作成します。Create the directory if it doesn't exist yet.
mkdir -p "$SPEECHSDK_ROOT"
Speech SDK バイナリを含む
.tar.gz
アーカイブをダウンロードして抽出します。Download and extract the.tar.gz
archive containing the Speech SDK binaries:wget -O SpeechSDK-Linux.tar.gz https://aka.ms/csspeech/linuxbinary tar --strip 1 -xzf SpeechSDK-Linux.tar.gz -C "$SPEECHSDK_ROOT"
展開されたパッケージの最上位ディレクトリの内容を検証します。Validate the contents of the top-level directory of the extracted package:
ls -l "$SPEECHSDK_ROOT"
ディレクトリの一覧には、サード パーティの通知やライセンスのファイルと、ヘッダー (
.h
) ファイルを格納しているinclude
ディレクトリおよびライブラリを格納しているlib
ディレクトリが含まれているはずです。The directory listing should contain the third-party notice and license files, as well as aninclude
directory containing header (.h
) files and alib
directory containing libraries.PathPath 説明Description license.md
ライセンスLicense ThirdPartyNotices.md
サード パーティに関する通知。Third-party notices. REDIST.txt
再配布に関する通知。Redistribution notice. include
C および C++ に必要なヘッダー ファイルThe required header files for C and C++ lib/arm32
アプリケーションをリンクするために必要な ARM32 のネイティブ ライブラリNative library for ARM32 required to link your application lib/arm64
アプリケーションをリンクするために必要な ARM64 のネイティブ ライブラリNative library for ARM64 required to link your application lib/x64
アプリケーションをリンクするために必要な x64 のネイティブ ライブラリNative library for x64 required to link your application lib/x86
アプリケーションをリンクするために必要な x86 のネイティブ ライブラリNative library for x86 required to link your application
次のステップNext steps
- クイック スタート: マイクから音声を認識するQuickstart: Recognize speech from a microphone
- クイック スタート: ファイルから音声を認識するQuickstart: Recognize speech from a file
- クイックスタート: Azure BLOB から音声を認識するQuickstart: Recognize speech from an Azure Blob
- クイック スタート:音声テキスト変換の翻訳Quickstart: Translate speech-to-text
- クイックスタート: テキストをオーディオ デバイスに合成するQuickstart: Synthesize text to an audio device
- クイックスタート: テキストをファイルに合成するQuickstart: Synthesize text to a file
- クイックスタート: 意図を認識するQuickstart: Recognize Intents
ターゲット環境を選択してくださいChoose your target environment
このガイドでは、64 ビット Java 8 JRE 用 Speech SDK をインストールする方法について説明します。This guide shows how to install the Speech SDK for 64-bit Java 8 JRE. このパッケージ名の使用を自分で開始する場合、Java SDK は Maven Central Repository で使用できません。If you just want the package name to get started on your own, the Java SDK is not available in the Maven central repository. Gradle または pom.xml
依存関係ファイルを使用しているかどうかに関係なく、https://csspeechstorage.blob.core.windows.net/maven/
を指すカスタム リポジトリを追加する必要があります (パッケージ名については以下を参照してください)。Whether you're using Gradle or a pom.xml
dependency file, you need to add a custom repository pointing to https://csspeechstorage.blob.core.windows.net/maven/
(see below for package name).
注意
Speech Devices SDK および Roobo デバイスについては、Speech Devices SDK を参照してください。For the Speech Devices SDK and the Roobo device, see Speech Devices SDK.
重要
Azure Cognitive Services Speech SDK のいずれかをダウンロードした時点で、同 SDK のライセンス条件に同意したものと見なされます。By downloading any of the Azure Cognitive Services Speech SDKs, you acknowledge its license. 詳細については、次を参照してください。For more information, see:
サポートされるオペレーティング システムSupported operating systems
- 以下のオペレーティング システム用の Java Speech SDK パッケージを入手できます。The Java Speech SDK package is available for these operating systems:
- Windows: 64 ビットのみWindows: 64-bit only
- Mac: macOS X バージョン 10.13 以降Mac: macOS X version 10.13 or later
- Linux。サポートされている Linux ディストリビューションとターゲット アーキテクチャの一覧を参照してください。Linux; see the list of supported Linux distributions and target architectures.
前提条件Prerequisites
Windows では、お使いのプラットフォームに対応した Microsoft Visual Studio 2019 の Visual C++ 再頒布可能パッケージが必要です。On Windows, you need the Microsoft Visual C++ Redistributable for Visual Studio 2019 for your platform. これを初めてインストールする場合、再起動が必要になる場合があります。Installing this for the first time may require a restart.
Eclipse Java IDE (Java が既にインストールされている必要があります)Eclipse Java IDE (requires Java already installed)
サポートされている Linux プラットフォームでは、特定のライブラリがインストールされている必要があります (Secure Sockets Layer サポート用に
libssl
、サウンド サポート用にlibasound2
)。Supported Linux platforms will require certain libraries installed (libssl
for secure sockets layer support andlibasound2
for sound support). これらのライブラリの正しいバージョンをインストールするために必要なコマンドについては、下記のディストリビューションを参照してください。Refer to your distribution below for the commands needed to install the correct versions of these libraries.Ubuntu/Debian では、次のコマンドを実行して、必要なパッケージをインストールします。On Ubuntu/Debian, run the following commands to install the required packages:
sudo apt-get update sudo apt-get install build-essential libssl1.0.0 libasound2
libssl1.0.0 が使用できない場合は、libssl1.0.x (ここで、x は 0 より大) または libssl1.1 を代わりにインストールします。If libssl1.0.0 is not available, install libssl1.0.x (where x is greater than 0) or libssl1.1 instead.
RHEL または CentOS では、以下のコマンドを実行して、必要なパッケージをインストールします。On RHEL/CentOS, run the following commands to install the required packages:
sudo yum update sudo yum install alsa-lib java-1.8.0-openjdk-devel openssl
注意
- RHEL または CentOS 7 の場合、「Speech SDK 用に RHEL/CentOS 7 を構成する」の手順に従います。On RHEL/CentOS 7, follow the instructions on how to configure RHEL/CentOS 7 for Speech SDK.
- RHEL または CentOS 8 の場合、「Linux 用 OpenSSL の構成」の手順に従います。On RHEL/CentOS 8, follow the instructions on how to configure OpenSSL for Linux.
- Windows では、お使いのプラットフォームに対応した Microsoft Visual Studio 2019 の Visual C++ 再頒布可能パッケージが必要です。On Windows, you need the Microsoft Visual C++ Redistributable for Visual Studio 2019 for your platform. パッケージを初めてインストールする場合、このガイドを続行する前に Windows の再起動が必要になる場合があることに注意してください。Note that installing this for the first time may require you to restart Windows before continuing with this guide.
Eclipse プロジェクトを作成して Speech SDK をインストールするCreate an Eclipse project and install the Speech SDK
Eclipse を起動します。Start Eclipse.
[Eclipse Launcher] で、新しいディレクトリの名前を [Workspace] フィールドに入力します。In the Eclipse Launcher, in the Workspace field, enter the name of a new workspace directory. 次に [Launch] を選択します。Then select Launch.
しばらくすると、Eclipse IDE のメイン ウィンドウが表示されます。In a moment, the main window of the Eclipse IDE appears. ウェルカム 画面が表示される場合は画面を閉じます。Close the Welcome screen if one is present.
Eclipse メニュー バーから、 [File] > [New] > [Project] を選択して新しいプロジェクトを作成します。From the Eclipse menu bar, create a new project by choosing File > New > Project.
[新しいプロジェクト] ダイアログ ボックスが表示されます。The New Project dialog box appears. [Java Project] を選択し、 [Next] を選択します。Select Java Project, and select Next.
新規 Java プロジェクト ウィザードが開始されます。The New Java Project wizard starts. [Project name] フィールドに「quickstaart」と入力し、実行環境として [JavaSE-1.8] を選択します。In the Project name field, enter quickstart, and choose JavaSE-1.8 as the execution environment. [完了] を選択します。Select Finish.
[Open Associated Perspective?](パースペクティブを開きますか?) というウィンドウが表示される場合は、 [Open Perspective](パースペクティブを開く) を選択します。If the Open Associated Perspective? window appears, select Open Perspective.
Package explorer で、quickstart プロジェクトを右クリックします。In the Package explorer, right-click the quickstart project. コンテキスト メニューから、 [Configure] > [Convert to Maven Project] を選択します。Choose Configure > Convert to Maven Project from the context menu.
[Create new POM] ウィンドウが表示されます。The Create new POM window appears. [Group Id](グループ ID) フィールドに、「com.microsoft.cognitiveservices.speech.samples」と入力し、 [Artifact Id](成果物 ID) フィールドに、「quickstart」と入力します。In the Group Id field, enter com.microsoft.cognitiveservices.speech.samples, and in the Artifact Id field, enter quickstart. [完了] を選択します。Then select Finish.
pom.xml ファイルを開いて編集します。Open the pom.xml file and edit it.
ファイルの最後にある、終了タグ
</project>
の前に、次に示すように Speech SDK 用の Maven リポジトリへの参照を含むrepositories
要素を作成します。At the end of the file, before the closing tag</project>
, create arepositories
element with a reference to the Maven repository for the Speech SDK, as shown here:<repositories> <repository> <id>maven-cognitiveservices-speech</id> <name>Microsoft Cognitive Services Speech Maven Repository</name> <url>https://csspeechstorage.blob.core.windows.net/maven/</url> </repository> </repositories>
依存関係として Speech SDK バージョン 1.15.0 を指定した
dependencies
要素も追加します。Also add adependencies
element, with the Speech SDK version 1.15.0 as a dependency:<dependencies> <dependency> <groupId>com.microsoft.cognitiveservices.speech</groupId> <artifactId>client-sdk</artifactId> <version>1.12.1</version> </dependency> </dependencies>
変更を保存します。Save the changes.
次のステップNext steps
- クイック スタート: マイクから音声を認識するQuickstart: Recognize speech from a microphone
- クイック スタート: ファイルから音声を認識するQuickstart: Recognize speech from a file
- クイックスタート: Azure BLOB から音声を認識するQuickstart: Recognize speech from an Azure Blob
- クイック スタート:音声テキスト変換の翻訳Quickstart: Translate speech-to-text
- クイックスタート: テキストをオーディオ デバイスに合成するQuickstart: Synthesize text to an audio device
- クイックスタート: テキストをファイルに合成するQuickstart: Synthesize text to a file
- クイックスタート: 意図を認識するQuickstart: Recognize Intents
このガイドでは、Python 用 Speech SDK をインストールする方法について説明します。This guide shows how to install the Speech SDK for Python. このパッケージ名の使用を自分で開始する場合は、pip install azure-cognitiveservices-speech
を実行します。If you just want the package name to get started on your own, run pip install azure-cognitiveservices-speech
.
重要
Azure Cognitive Services Speech SDK のいずれかをダウンロードした時点で、同 SDK のライセンス条件に同意したものと見なされます。By downloading any of the Azure Cognitive Services Speech SDKs, you acknowledge its license. 詳細については、次を参照してください。For more information, see:
サポートされるオペレーティング システムSupported operating systems
- 以下のオペレーティング システム用の Python Speech SDK パッケージを入手できます。The Python Speech SDK package is available for these operating systems:
- Windows: x64 および x86Windows: x64 and x86
- Mac: macOS X バージョン 10.12 以降Mac: macOS X version 10.12 or later
- Linux。サポートされている Linux ディストリビューションとターゲット アーキテクチャの一覧を参照してください。Linux; see the list of supported Linux distributions and target architectures.
前提条件Prerequisites
Windows では、お使いのプラットフォームに対応した Microsoft Visual Studio 2019 の Visual C++ 再頒布可能パッケージが必要です。On Windows, you need the Microsoft Visual C++ Redistributable for Visual Studio 2019 for your platform. これを初めてインストールする場合、再起動が必要になる場合があります。Installing this for the first time may require a restart.
サポートされている Linux プラットフォームでは、特定のライブラリがインストールされている必要があります (Secure Sockets Layer サポート用に
libssl
、サウンド サポート用にlibasound2
)。Supported Linux platforms will require certain libraries installed (libssl
for secure sockets layer support andlibasound2
for sound support). これらのライブラリの正しいバージョンをインストールするために必要なコマンドについては、下記のディストリビューションを参照してください。Refer to your distribution below for the commands needed to install the correct versions of these libraries.Ubuntu/Debian では、次のコマンドを実行して、必要なパッケージをインストールします。On Ubuntu/Debian, run the following commands to install the required packages:
sudo apt-get update sudo apt-get install build-essential libssl1.0.0 libasound2
libssl1.0.0 が使用できない場合は、libssl1.0.x (ここで、x は 0 より大) または libssl1.1 を代わりにインストールします。If libssl1.0.0 is not available, install libssl1.0.x (where x is greater than 0) or libssl1.1 instead.
RHEL または CentOS では、以下のコマンドを実行して、必要なパッケージをインストールします。On RHEL/CentOS, run the following commands to install the required packages:
sudo yum update sudo yum install alsa-lib openssl python3
注意
- RHEL または CentOS 7 の場合、「Speech SDK 用に RHEL/CentOS 7 を構成する」の手順に従います。On RHEL/CentOS 7, follow the instructions on how to configure RHEL/CentOS 7 for Speech SDK.
- RHEL または CentOS 8 の場合、「Linux 用 OpenSSL の構成」の手順に従います。On RHEL/CentOS 8, follow the instructions on how to configure OpenSSL for Linux.
- Windows では、お使いのプラットフォームに対応した Microsoft Visual Studio 2019 の Visual C++ 再頒布可能パッケージが必要です。On Windows, you need the Microsoft Visual C++ Redistributable for Visual Studio 2019 for your platform. パッケージを初めてインストールする場合、このガイドを続行する前に Windows の再起動が必要になる場合があることに注意してください。Note that installing this for the first time may require you to restart Windows before continuing with this guide.
- 最後に、Python 3.6 から 3.9 が必要になります。And finally, you'll need Python 3.6 to 3.9. インストールを確認するには、コマンド プロンプトを開き、コマンド
python --version
を入力して、結果を確認します。To check your installation, open a command prompt and type the commandpython --version
and check the result. 適切にインストールされた場合、"Python 3.8.8" のような応答が返されます。If it's installed properly, you'll get a response like "Python 3.8.8".
PyPI から Speech SDK をインストールするInstall the Speech SDK from PyPI
独自の環境またはビルド ツールを使用している場合は、次のコマンドを実行して PyPI から Speech SDK をインストールします。If you're using your own environment or build tools, run the following command to install the Speech SDK from PyPI. Visual Studio Code のユーザーの場合は、ガイド付きのインストールに関する次のサブセクションにスキップしてください。For users of Visual Studio Code, skip to the next sub-section for guided installation.
pip install azure-cognitiveservices-speech
macOS を使用している場合は、次のコマンドを実行して、上記の pip
コマンドを取得する必要があります。If you are on macOS, you may need to run the following command to get the pip
command above to work:
python3 -m pip install --upgrade pip
pip
を正常に使用して azure-cognitiveservices-speech
をインストールしたら、その名前空間を Python プロジェクトにインポートすることで、Speech SDK を使用できます。Once you've successfully used pip
to install azure-cognitiveservices-speech
, you can use the Speech SDK by importing the namespace into your Python projects.
import azure.cognitiveservices.speech as speechsdk
Visual Studio Code を使用して Speech SDK をインストールするInstall the Speech SDK using Visual Studio Code
お使いのプラットフォームでサポートされている最新バージョンの Python (3.6 から 3.9) をダウンロードしてインストールします。Download and install the latest supported version of Python for your platform, 3.6 to 3.9.
- Windows ユーザーは、インストールプロセス中に [Add Python to your PATH](Python をパスに追加する) を選択していることを確認してください。Windows users make sure to select "Add Python to your PATH" during the installation process.
Visual Studio Code をダウンロードして、インストールします。Download and install Visual Studio Code.
Visual Studio Code を開いて、Python 拡張機能をインストールします。Open Visual Studio Code and install the Python extension. メニューで [ファイル] > [基本設定] > [拡張機能] の順に選択します。Select File > Preferences > Extensions from the menu. Python を検索して、 [インストール] をクリックします。Search for Python and click Install.
または、Visual Studio Code 内から、統合コマンド ラインで Speech SDK Python パッケージをインストールします。Also from within Visual Studio Code, install the Speech SDK Python package from the integrated command line:
- ターミナル (ドロップダウン メニューから、 [ターミナル] > [新しいターミナル] ) を開きますOpen a terminal (from the drop-down menus, Terminal > New Terminal)
- ターミナルが開いたら、コマンド
python -m pip install azure-cognitiveservices-speech
を入力しますIn the terminal that opens, enter the commandpython -m pip install azure-cognitiveservices-speech
Visual Studio Code を初めて使用する場合は、詳細な Visual Studio Code のドキュメント を参照してください。If you are new to Visual Studio Code, refer to the more extensive Visual Studio Code Documentation. Visual Studio Code および Python の詳細については、Visual Studio Code Python のチュートリアルに関するページをご覧ください。For more information about Visual Studio Code and Python, see Visual Studio Code Python tutorial.
サポートと更新プログラムSupport and updates
Speech SDK Python パッケージの更新プログラムは、PyPI を通じて配布され、リリース ノートで発表されます。Updates to the Speech SDK Python package are distributed via PyPI and announced in the Release notes.
新しいバージョンが利用可能な場合は、コマンド pip install --upgrade azure-cognitiveservices-speech
を使用してそれに更新できます。If a new version is available, you can update to it with the command pip install --upgrade azure-cognitiveservices-speech
.
azure.cognitiveservices.speech.__version__
変数を調べて、現在インストールされているバージョンを確認します。Check which version is currently installed by inspecting the azure.cognitiveservices.speech.__version__
variable.
問題があるか、機能が欠落している場合は、「サポート オプションとヘルプ オプション」を参照してください。If you have a problem, or you're missing a feature, see Support and help options.
次のステップNext steps
- クイック スタート: マイクから音声を認識するQuickstart: Recognize speech from a microphone
- クイック スタート: ファイルから音声を認識するQuickstart: Recognize speech from a file
- クイックスタート: Azure BLOB から音声を認識するQuickstart: Recognize speech from an Azure Blob
- クイック スタート:音声テキスト変換の翻訳Quickstart: Translate speech-to-text
- クイックスタート: テキストをオーディオ デバイスに合成するQuickstart: Synthesize text to an audio device
- クイックスタート: テキストをファイルに合成するQuickstart: Synthesize text to a file
- クイックスタート: 意図を認識するQuickstart: Recognize Intents
このガイドでは、Linux 用 Speech SDK をインストールする方法について説明しますThis guide shows how to install the Speech SDK for Linux
重要
Azure Cognitive Services Speech SDK のいずれかをダウンロードした時点で、同 SDK のライセンス条件に同意したものと見なされます。By downloading any of the Azure Cognitive Services Speech SDKs, you acknowledge its license. 詳細については、次を参照してください。For more information, see:
システム要件System requirements
Linux。サポートされている Linux ディストリビューションとターゲット アーキテクチャの一覧を参照してください。Linux; see the list of supported Linux distributions and target architectures.
前提条件Prerequisites
このクイックスタートを完了するには、次のものが必要です。To complete this quickstart, you'll need:
Windows では、お使いのプラットフォームに対応した Microsoft Visual Studio 2019 の Visual C++ 再頒布可能パッケージが必要です。On Windows, you need the Microsoft Visual C++ Redistributable for Visual Studio 2019 for your platform. これを初めてインストールする場合、再起動が必要になる場合があります。Installing this for the first time may require a restart.
gccgcc
サポートされている Linux プラットフォームでは、特定のライブラリがインストールされている必要があります (Secure Sockets Layer サポート用に
libssl
、サウンド サポート用にlibasound2
)。Supported Linux platforms will require certain libraries installed (libssl
for secure sockets layer support andlibasound2
for sound support). これらのライブラリの正しいバージョンをインストールするために必要なコマンドについては、下記のディストリビューションを参照してください。Refer to your distribution below for the commands needed to install the correct versions of these libraries.Ubuntu/Debian の場合:On Ubuntu/Debian:
sudo apt-get update sudo apt-get install build-essential libssl1.0.0 libasound2 wget
libssl1.0.0 が使用できない場合は、libssl1.0.x (ここで、x は 0 より大) または libssl1.1 を代わりにインストールします。If libssl1.0.0 is not available, install libssl1.0.x (where x is greater than 0) or libssl1.1 instead.
RHEL または CentOS の場合:On RHEL/CentOS:
sudo yum update sudo yum groupinstall "Development tools" sudo yum install alsa-lib openssl wget
注意
- RHEL または CentOS 7 の場合、「Speech SDK 用に RHEL/CentOS 7 を構成する」の手順に従います。On RHEL/CentOS 7, follow the instructions on how to configure RHEL/CentOS 7 for Speech SDK.
- RHEL または CentOS 8 の場合、「Linux 用 OpenSSL の構成」の手順に従います。On RHEL/CentOS 8, follow the instructions on how to configure OpenSSL for Linux.
Speech SDK をインストールするInstall Speech SDK
Linux 用 Speech SDK は、64 ビット アプリケーションと 32 ビット アプリケーションのどちらの構築にも使用できます。The Speech SDK for Linux can be used to build both 64-bit and 32-bit applications. 必要なライブラリとヘッダー ファイルは、https://aka.ms/csspeech/linuxbinary から tar ファイルとしてダウンロードできます。The required libraries and header files can be downloaded as a tar file from https://aka.ms/csspeech/linuxbinary.
SDK を次のようにダウンロードしてインストールします。Download and install the SDK as follows:
Speech SDK のファイル抽出先にする必要があるディレクトリを選択し、そのディレクトリを指すように
SPEECHSDK_ROOT
環境変数を設定します。Choose a directory to which the Speech SDK files should be extracted, and set theSPEECHSDK_ROOT
environment variable to point to that directory. この変数によって、後のコマンドでこのディレクトリを参照することが容易になります。This variable makes it easy to refer to the directory in future commands. たとえば、ホーム ディレクトリでspeechsdk
ディレクトリを使用する場合、次のようなコマンドを使用します。For example, if you want to use the directoryspeechsdk
in your home directory, use a command like the following:export SPEECHSDK_ROOT="$HOME/speechsdk"
このディレクトリがまだ存在しない場合は作成します。Create the directory if it doesn't exist yet.
mkdir -p "$SPEECHSDK_ROOT"
Speech SDK バイナリを含む
.tar.gz
アーカイブをダウンロードして抽出します。Download and extract the.tar.gz
archive containing the Speech SDK binaries:wget -O SpeechSDK-Linux.tar.gz https://aka.ms/csspeech/linuxbinary tar --strip 1 -xzf SpeechSDK-Linux.tar.gz -C "$SPEECHSDK_ROOT"
展開されたパッケージの最上位ディレクトリの内容を検証します。Validate the contents of the top-level directory of the extracted package:
ls -l "$SPEECHSDK_ROOT"
ディレクトリの一覧には、サード パーティの通知やライセンスのファイルと、ヘッダー (
.h
) ファイルを格納しているinclude
ディレクトリおよびライブラリを格納しているlib
ディレクトリが含まれているはずです。The directory listing should contain the third-party notice and license files, as well as aninclude
directory containing header (.h
) files and alib
directory containing libraries.PathPath 説明Description license.md
ライセンスLicense ThirdPartyNotices.md
サード パーティに関する通知。Third-party notices. REDIST.txt
再配布に関する通知。Redistribution notice. include
C および C++ に必要なヘッダー ファイルThe required header files for C and C++ lib/arm32
アプリケーションをリンクするために必要な ARM32 のネイティブ ライブラリNative library for ARM32 required to link your application lib/arm64
アプリケーションをリンクするために必要な ARM64 のネイティブ ライブラリNative library for ARM64 required to link your application lib/x64
アプリケーションをリンクするために必要な x64 のネイティブ ライブラリNative library for x64 required to link your application lib/x86
アプリケーションをリンクするために必要な x86 のネイティブ ライブラリNative library for x86 required to link your application
Go 環境を構成するConfigure Go environment
次の手順を実行して、Speech SDK を検索するための Go 環境を設定します。Perform the following steps to set up your Go environment to find the Speech SDK. 両方の手順で、<architecture>
を CPU のプロセッサ アーキテクチャに置き換えます。In both steps, replace <architecture>
with the processor architecture of your CPU. これは x86
、x64
、arm32
、arm64
のいずれかになります。This will be x86
, x64
, arm32
, or arm64
.
バインドは
cgo
に依存するため、Go が SDK を検出できるように環境変数を設定する必要があります。Since the bindings rely oncgo
, you need to set the environment variables so Go can find the SDK:export CGO_CFLAGS="-I$SPEECHSDK_ROOT/include/c_api" export CGO_LDFLAGS="-L$SPEECHSDK_ROOT/lib/<architecture> -lMicrosoft.CognitiveServices.Speech.core"
その SDK を含むアプリケーションを実行するには、ライブラリの検索先を OS に伝える必要があります。To run applications including the SDK, we need to tell the OS where to find the libs:
export LD_LIBRARY_PATH="$SPEECHSDK_ROOT/lib/<architecture>:$LD_LIBRARY_PATH"
次のステップNext steps
- クイック スタート: マイクから音声を認識するQuickstart: Recognize speech from a microphone
- クイック スタート: ファイルから音声を認識するQuickstart: Recognize speech from a file
- クイック スタート: カスタム音声アシスタントを作成するQuickstart: Create a custom voice assistant
ターゲット環境を選択してくださいChoose your target environment
このガイドでは、Web ページで使用する JavaScript 用の Speech SDK をインストールする方法について説明します。This guide shows how to install the Speech SDK for JavaScript for use with a web page.
重要
Azure Cognitive Services Speech SDK のいずれかをダウンロードした時点で、同 SDK のライセンス条件に同意したものと見なされます。By downloading any of the Azure Cognitive Services Speech SDKs, you acknowledge its license. 詳細については、次を参照してください。For more information, see:
新しい Web サイト フォルダーを作成するCreate a new Website folder
新しい空のフォルダーを作成します。Create a new, empty folder. Web サーバーでサンプルをホストする場合は、Web サーバーがフォルダーにアクセスできることを確認します。In case you want to host the sample on a web server, make sure that the web server can access the folder.
JavaScript 用 Speech SDK をフォルダーに解凍するUnpack the Speech SDK for JavaScript into that folder
Speech SDK を .zip パッケージとしてダウンロードし、新しく作成したフォルダーに解凍します。Download the Speech SDK as a .zip package and unpack it into the newly created folder. 次の 5 つのファイルが解凍されます。This results in five files being unpacked:
microsoft.cognitiveservices.speech.sdk.bundle.js
人が判読できるバージョンの Speech SDK。microsoft.cognitiveservices.speech.sdk.bundle.js
A human readable version of the Speech SDK.microsoft.cognitiveservices.speech.sdk.bundle.js.map
SDK コードのデバッグに使用されるマップ ファイル。microsoft.cognitiveservices.speech.sdk.bundle.js.map
A map file used for debugging SDK code.microsoft.cognitiveservices.speech.sdk.bundle.d.ts
TypeScript で使用するオブジェクトの定義。microsoft.cognitiveservices.speech.sdk.bundle.d.ts
Object definitions for use with TypeScriptmicrosoft.cognitiveservices.speech.sdk.bundle-min.js
Speech SDK の縮小版。microsoft.cognitiveservices.speech.sdk.bundle-min.js
A minified version of the Speech SDK.speech-processor.js
一部のブラウザーでパフォーマンスを改善するコード。speech-processor.js
Code to improve performance on some browsers.
index.html ページを作成するCreate an index.html page
フォルダーに index.html
という名前の新しいファイルを作成し、テキスト エディターでこのファイルを開きます。Create a new file in the folder, named index.html
and open this file with a text editor.
次のステップNext steps
- クイック スタート: マイクから音声を認識するQuickstart: Recognize speech from a microphone
- クイック スタート: ファイルから音声を認識するQuickstart: Recognize speech from a file
- クイックスタート: Azure BLOB から音声を認識するQuickstart: Recognize speech from an Azure Blob
- クイック スタート:音声テキスト変換の翻訳Quickstart: Translate speech-to-text
- クイックスタート: テキストをオーディオ デバイスに合成するQuickstart: Synthesize text to an audio device
- クイックスタート: テキストをファイルに合成するQuickstart: Synthesize text to a file
- クイックスタート: 意図を認識するQuickstart: Recognize Intents