Skip to content

Commit 3134ceb

Browse files
authored
Merge pull request #186758 from paulth1/codec-compressed-audio-input-streams
edit pass: codec-compressed-audio-input-streams
2 parents fef66cb + c66be87 commit 3134ceb

File tree

12 files changed

+43
-41
lines changed

12 files changed

+43
-41
lines changed

articles/cognitive-services/Speech-Service/how-to-use-codec-compressed-audio-input-streams.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ The Speech SDK and Speech CLI use GStreamer to support different kinds of input
2121

2222
[!INCLUDE [supported-audio-formats](includes/supported-audio-formats.md)]
2323

24-
## Installing GStreamer
24+
## Install GStreamer
2525

26-
Choose a platform for installation instructions.
26+
Choose a platform for installation instructions.
2727

2828
Platform | Languages | Supported GStreamer version
2929
| :--- | ---: | :---:
30-
Android | Java | [1.18.3](https://gstreamer.freedesktop.org/data/pkg/android/1.18.3/)
31-
Linux | C++, C#, Java, Python, Go | [Supported Linux distributions and target architectures](~/articles/cognitive-services/speech-service/speech-sdk.md)
32-
Windows (excluding UWP) | C++, C#, Java, Python | [1.18.3](https://gstreamer.freedesktop.org/data/pkg/windows/1.18.3/msvc/gstreamer-1.0-msvc-x86_64-1.18.3.msi)
30+
Android | Java | [1.18.3](https://gstreamer.freedesktop.org/data/pkg/android/1.18.3/)
31+
Linux | C++, C#, Java, Python, Go | [Supported Linux distributions and target architectures](~/articles/cognitive-services/speech-service/speech-sdk.md)
32+
Windows (excluding UWP) | C++, C#, Java, Python | [1.18.3](https://gstreamer.freedesktop.org/data/pkg/windows/1.18.3/msvc/gstreamer-1.0-msvc-x86_64-1.18.3.msi)
3333

3434
### [Android](#tab/android)
3535

36-
See [GStreamer configuration by programming language](#gstreamer-configuration) for the details about building libgstreamer_android.so.
36+
For more information about building libgstreamer_android.so, see [GStreamer configuration by programming language](#gstreamer-configuration).
3737

38-
For more information, see [Android installation instructions](https://gstreamer.freedesktop.org/documentation/installing/for-android-development.html?gi-language=c).
38+
For more information, see [Android installation instructions](https://gstreamer.freedesktop.org/documentation/installing/for-android-development.html?gi-language=c).
3939

4040
### [Linux](#tab/linux)
4141

@@ -50,32 +50,32 @@ gstreamer1.0-plugins-ugly
5050
```
5151
### [Windows](#tab/windows)
5252

53-
Make sure that packages of the same platform (x64 or x86) are installed. For example, if you installed the x64 package for Python, then you need to install the x64 GStreamer package. The instructions below are for the x64 packages.
53+
Make sure that packages of the same platform (x64 or x86) are installed. For example, if you installed the x64 package for Python, you need to install the x64 GStreamer package. The following instructions are for the x64 packages.
5454

55-
1. Create a folder c:\gstreamer
56-
1. Download [installer](https://gstreamer.freedesktop.org/data/pkg/windows/1.18.3/msvc/gstreamer-1.0-msvc-x86_64-1.18.3.msi)
57-
1. Copy the installer to c:\gstreamer
55+
1. Create the folder c:\gstreamer.
56+
1. Download the [installer](https://gstreamer.freedesktop.org/data/pkg/windows/1.18.3/msvc/gstreamer-1.0-msvc-x86_64-1.18.3.msi).
57+
1. Copy the installer to c:\gstreamer.
5858
1. Open PowerShell as an administrator.
59-
1. Run the following command in the PowerShell:
59+
1. Run the following command in PowerShell:
6060

6161
```powershell
6262
cd c:\gstreamer
6363
msiexec /passive INSTALLLEVEL=1000 INSTALLDIR=C:\gstreamer /i gstreamer-1.0-msvc-x86_64-1.18.3.msi
6464
```
6565
66-
1. Add the system variables GST_PLUGIN_PATH with value C:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0
67-
1. Add the system variables GSTREAMER_ROOT_X86_64 with value C:\gstreamer\1.0\msvc_x86_64
68-
1. Add another entry in the path variable as C:\gstreamer\1.0\msvc_x86_64\bin
69-
1. Reboot the machine
66+
1. Add the system variables GST_PLUGIN_PATH with the value C:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0.
67+
1. Add the system variables GSTREAMER_ROOT_X86_64 with the value C:\gstreamer\1.0\msvc_x86_64.
68+
1. Add another entry in the path variable as C:\gstreamer\1.0\msvc_x86_64\bin.
69+
1. Reboot the machine.
7070
71-
For more information about GStreamer, see [Windows installation instructions](https://gstreamer.freedesktop.org/documentation/installing/on-windows.html?gi-language=c).
71+
For more information about GStreamer, see [Windows installation instructions](https://gstreamer.freedesktop.org/documentation/installing/on-windows.html?gi-language=c).
7272
7373
***
7474
7575
## GStreamer configuration
7676
7777
> [!NOTE]
78-
> GStreamer configuration requirements vary by programming language. For details, choose your programming language at the top of this page. The contents of this section will be updated.
78+
> GStreamer configuration requirements vary by programming language. For more information, choose your programming language at the top of this page. The contents of this section will be updated.
7979
8080
::: zone pivot="programming-language-csharp"
8181
[!INCLUDE [prerequisites](includes/how-to/compressed-audio-input/csharp/prerequisites.md)]

articles/cognitive-services/Speech-Service/includes/how-to/compressed-audio-input/cpp/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ ms.date: 03/09/2020
66
ms.author: eur
77
---
88

9-
To configure Speech SDK to accept compressed audio input, create `PullAudioInputStream` or `PushAudioInputStream`. Then, create an `AudioConfig` from an instance of your stream class, specifying the compression format of the stream. Find related sample code in [Speech SDK samples](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/cpp/windows/console/samples/speaker_recognition_samples.cpp).
9+
To configure the Speech SDK to accept compressed audio input, create `PullAudioInputStream` or `PushAudioInputStream`. Then, create an `AudioConfig` from an instance of your stream class that specifies the compression format of the stream. Find related sample code in [Speech SDK samples](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/cpp/windows/console/samples/speaker_recognition_samples.cpp).
1010

11-
Let's assume that you have an input stream class called `pushStream` and are using OPUS/OGG. Your code may look like this:
11+
Let's assume that you have an input stream class called `pushStream` and are using OPUS/OGG. Your code might look like this:
1212

1313
```cpp
1414
using namespace Microsoft::CognitiveServices::Speech;

articles/cognitive-services/Speech-Service/includes/how-to/compressed-audio-input/cpp/prerequisites.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.date: 03/09/2020
66
ms.author: eur
77
---
88

9-
Handling compressed audio is implemented using [GStreamer](https://gstreamer.freedesktop.org). For licensing reasons GStreamer binaries are not compiled and linked with the Speech SDK. Developers need to install several dependencies and plugins.
9+
Handling compressed audio is implemented by using [GStreamer](https://gstreamer.freedesktop.org). For licensing reasons, GStreamer binaries aren't compiled and linked with the Speech SDK. You need to install several dependencies and plug-ins.
1010

1111
# [Ubuntu/Debian](#tab/debian)
1212

@@ -29,7 +29,7 @@ gstreamer1-plugins-ugly-free
2929
```
3030

3131
> [!NOTE]
32-
> - On RHEL/CentOS 7 and RHEL/CentOS 8, in case of using "ANY" compressed format, more GStreamer plugins needs to be installed if stream media format plugin is not in the above installed plugins.
32+
> On RHEL/CentOS 7 and RHEL/CentOS 8, in case of using "ANY" compressed format, more GStreamer plug-ins need to be installed if the stream media format plug-in isn't in the preceding installed plug-ins.
3333
3434

3535
---

articles/cognitive-services/Speech-Service/includes/how-to/compressed-audio-input/csharp/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ ms.author: eur
77
ms.custom: devx-track-csharp
88
---
99

10-
To configure Speech SDK to accept compressed audio input, create `PullAudioInputStream` or `PushAudioInputStream`. Then, create an `AudioConfig` from an instance of your stream class, specifying the compression format of the stream. Find related sample code snippets in [About the Speech SDK audio input stream API](../../../../how-to-use-audio-input-streams.md).
10+
To configure the Speech SDK to accept compressed audio input, create `PullAudioInputStream` or `PushAudioInputStream`. Then, create an `AudioConfig` from an instance of your stream class that specifies the compression format of the stream. Find related sample code snippets in [About the Speech SDK audio input stream API](../../../../how-to-use-audio-input-streams.md).
1111

12-
Let's assume that you have an input stream class called `pullStream` and are using OPUS/OGG. Your code may look like this:
12+
Let's assume that you have an input stream class called `pullStream` and are using OPUS/OGG. Your code might look like this:
1313

1414
```csharp
1515
using Microsoft.CognitiveServices.Speech;

articles/cognitive-services/Speech-Service/includes/how-to/compressed-audio-input/csharp/prerequisites.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ ms.date: 03/09/2020
66
ms.author: eur
77
---
88

9-
Handling compressed audio is implemented using [GStreamer](https://gstreamer.freedesktop.org). For licensing reasons GStreamer binaries are not compiled and linked with the Speech SDK. Developers need to install several dependencies and plugins, see [Installing on Windows](https://gstreamer.freedesktop.org/documentation/installing/on-windows.html?gi-language=c) or [Installing on Linux](https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c). GStreamer binaries need to be in the system path, so that the Speech SDK can load the binaries during runtime. For example, on Windows, if the Speech SDK is able to find `libgstreamer-1.0-0.dll` or `gstreamer-1.0-0.dll` (for latest GStreamer) during runtime, it means the GStreamer binaries are in the system path.
9+
Handling compressed audio is implemented by using [GStreamer](https://gstreamer.freedesktop.org). For licensing reasons, GStreamer binaries aren't compiled and linked with the Speech SDK. You need to install several dependencies and plug-ins. For more information, see [Installing on Windows](https://gstreamer.freedesktop.org/documentation/installing/on-windows.html?gi-language=c) or [Installing on Linux](https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c).
10+
11+
GStreamer binaries need to be in the system path so that the Speech SDK can load the binaries during runtime. For example, on Windows, if the Speech SDK finds `libgstreamer-1.0-0.dll` or `gstreamer-1.0-0.dll` (for the latest GStreamer) during runtime, it means the GStreamer binaries are in the system path.
1012

articles/cognitive-services/Speech-Service/includes/how-to/compressed-audio-input/go/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ ms.date: 09/17/2021
66
ms.author: amishu
77
---
88

9-
To configure the Speech SDK to accept compressed audio input, create a `PullAudioInputStream` or `PushAudioInputStream`. Then, create an `AudioConfig` from an instance of your stream class, specifying the compression format of the stream.
9+
To configure the Speech SDK to accept compressed audio input, create a `PullAudioInputStream` or `PushAudioInputStream`. Then, create an `AudioConfig` from an instance of your stream class that specifies the compression format of the stream.
1010

11-
In the following example let's assume that your use case is to use `PushStream` for a compressed file.
11+
In the following example, let's assume that your use case is to use `PushStream` for a compressed file.
1212

1313
```go
1414

articles/cognitive-services/Speech-Service/includes/how-to/compressed-audio-input/go/prerequisites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ ms.date: 09/17/2021
66
ms.author: amishu
77
---
88

9-
Speech SDK can use [GStreamer](https://gstreamer.freedesktop.org) to handle compressed audio. However, for licensing reasons GStreamer binaries are not compiled and linked with the Speech SDK. Developers need to install several dependencies and plugins, see [Installing on Linux](https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c). Go language is only supported in Speech SDK on the Linux platform. See [Speech SDK for Go](../../../../quickstarts/setup-platform.md?pivots=programming-language-go&tabs=dotnet%252cwindows%252cjre%252cbrowser) to get started with Microsoft Speech SDK in Go.
9+
Speech SDK can use [GStreamer](https://gstreamer.freedesktop.org) to handle compressed audio. For licensing reasons, GStreamer binaries aren't compiled and linked with the Speech SDK. You need to install several dependencies and plug-ins. For more information, see [Installing on Linux](https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c). Go language is only supported in the Speech SDK on the Linux platform. To get started with the Microsoft Speech SDK in Go, see [Speech SDK for Go](../../../../quickstarts/setup-platform.md?pivots=programming-language-go&tabs=dotnet%252cwindows%252cjre%252cbrowser).
1010

articles/cognitive-services/Speech-Service/includes/how-to/compressed-audio-input/java/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ ms.date: 03/09/2020
66
ms.author: eur
77
---
88

9-
To configure Speech SDK to accept compressed audio input, create a `PullAudioInputStream` or `PushAudioInputStream`. Then, create an `AudioConfig` from an instance of your stream class, specifying the compression format of the stream. Find related sample code in [Speech SDK samples](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/java/jre/console/src/com/microsoft/cognitiveservices/speech/samples/console/WavStream.java).
9+
To configure the Speech SDK to accept compressed audio input, create a `PullAudioInputStream` or `PushAudioInputStream`. Then, create an `AudioConfig` from an instance of your stream class that specifies the compression format of the stream. Find related sample code in [Speech SDK samples](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/java/jre/console/src/com/microsoft/cognitiveservices/speech/samples/console/WavStream.java).
1010

11-
Let's assume that you have an input stream class called `pullStream` and are using OPUS/OGG. Your code may look like this:
11+
Let's assume that you have an input stream class called `pullStream` and are using OPUS/OGG. Your code might look like this:
1212

1313
```java
1414
import com.microsoft.cognitiveservices.speech.audio.AudioConfig;

articles/cognitive-services/Speech-Service/includes/how-to/compressed-audio-input/java/prerequisites.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ ms.date: 03/09/2020
66
ms.author: eur
77
---
88

9-
Handling compressed audio is implemented using [GStreamer](https://gstreamer.freedesktop.org). For licensing reasons GStreamer binaries are not compiled and linked with the Speech SDK. Instead, you'll need to use the prebuilt binaries for Android. To download the prebuilt libraries, see [installing for Android development](https://gstreamer.freedesktop.org/documentation/installing/for-android-development.html?gi-language=c).
9+
Handling compressed audio is implemented by using [GStreamer](https://gstreamer.freedesktop.org). For licensing reasons, GStreamer binaries aren't compiled and linked with the Speech SDK. Instead, you need to use the prebuilt binaries for Android. To download the prebuilt libraries, see [Installing for Android development](https://gstreamer.freedesktop.org/documentation/installing/for-android-development.html?gi-language=c).
1010

11-
`libgstreamer_android.so` is required. Make sure that all the GStreamer plugins (from Android.mk file below) are linked in `libgstreamer_android.so`. When using the Speech SDK with GStreamer version 1.18.3, `libc++_shared.so` is also required to be present from android ndk.
11+
The `libgstreamer_android.so` object is required. Make sure that all the GStreamer plug-ins (from the Android.mk file that follows) are linked in `libgstreamer_android.so`. When you use the Speech SDK with GStreamer version 1.18.3, `libc++_shared.so` is also required to be present from android ndk.
1212

1313
```makefile
1414
GSTREAMER_PLUGINS := coreelements app audioconvert mpg123 \
1515
audioresample audioparsers ogg opusparse \
1616
opus wavparse alaw mulaw flac
1717
```
1818

19-
An example `Android.mk` and `Application.mk` file are provided below. Follow these steps to create the `gstreamer` shared object:`libgstreamer_android.so`.
19+
An example `Android.mk` and `Application.mk` file are provided here. Follow these steps to create the `gstreamer` shared object:`libgstreamer_android.so`.
2020

2121
```makefile
2222
# Android.mk
@@ -72,10 +72,10 @@ APP_PLATFORM = android-21
7272
APP_BUILD_SCRIPT = Android.mk
7373
```
7474

75-
You can build `libgstreamer_android.so` using the following command on Ubuntu 18.04 or 20.04. The following command lines have been tested for [GStreamer Android version 1.14.4](https://gstreamer.freedesktop.org/data/pkg/android/1.14.4/gstreamer-1.0-android-universal-1.14.4.tar.bz2) with [Android NDK b16b.](https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip)
75+
You can build `libgstreamer_android.so` by using the following command on Ubuntu 18.04 or 20.04. The following command lines have been tested for [GStreamer Android version 1.14.4](https://gstreamer.freedesktop.org/data/pkg/android/1.14.4/gstreamer-1.0-android-universal-1.14.4.tar.bz2) with [Android NDK b16b.](https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip)
7676

7777
```sh
78-
# Assuming wget and unzip already installed on the system
78+
# Assuming wget and unzip are already installed on the system
7979
mkdir buildLibGstreamer
8080
cd buildLibGstreamer
8181
wget https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip
@@ -104,4 +104,4 @@ ndk-build -C $(pwd)/gstreamer "NDK_APPLICATION_MK=Application.mk" APP_ABI=armeab
104104
#ndk-build -C $(pwd)/gstreamer "NDK_APPLICATION_MK=Application.mk" APP_ABI=x86 NDK_LIBS_OUT=$(pwd)
105105
```
106106

107-
Once the shared object (`libgstreamer_android.so`) is built application developer needs to place the shared object in the Android app, so that it can be loaded by speech SDK.
107+
After the shared object (`libgstreamer_android.so`) is built, place the shared object in the Android app so that the Speech SDK can load it.

articles/cognitive-services/Speech-Service/includes/how-to/compressed-audio-input/python/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ ms.date: 03/09/2020
66
ms.author: amishu
77
---
88

9-
To configure Speech SDK to accept compressed audio input, create `PullAudioInputStream` or `PushAudioInputStream`. Then, create an `AudioConfig` from an instance of your stream class, specifying the compression format of the stream.
9+
To configure the Speech SDK to accept compressed audio input, create `PullAudioInputStream` or `PushAudioInputStream`. Then, create an `AudioConfig` from an instance of your stream class that specifies the compression format of the stream.
1010

11-
Let's assume that your use case is to use `PullStream` for an `MP3` file. Your code may look like this:
11+
Let's assume that your use case is to use `PullStream` for an `MP3` file. Your code might look like this:
1212

1313
```python
1414

0 commit comments

Comments
 (0)