Skip to content

Commit

Permalink
Brianem/1.14 samples update (#850)
Browse files Browse the repository at this point in the history
* publish the 1.14.0 release of public samples repo.

* 1.14 updates for public samples.

* 1.14 updates for public samples.
  • Loading branch information
BrianMouncer authored Oct 29, 2020
1 parent 98d518a commit b425737
Show file tree
Hide file tree
Showing 141 changed files with 14,014 additions and 5,540 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Please check [here](https://aka.ms/csspeech/whatsnew) for release notes and olde
This repository hosts samples that help you to get started with several features of the SDK.
In addition more complex scenarios are included to give you a head-start on using speech technology in your application.

We tested the samples with the latest released version of the SDK (1.6.0) on Windows 10, Linux (Ubuntu 16.04, Ubuntu 18.04, Debian 9), Android devices (API 23: Android 6.0 Marshmallow or higher), and iOS 11.4 devices.
We tested the samples with the latest released version of the SDK on Windows 10, Linux (on [supported Linux distributions and target architectures](https://docs.microsoft.com/azure/cognitive-services/speech-service/speech-sdk?tabs=linux)), Android devices (API 23: Android 6.0 Marshmallow or higher), and iOS 11.4 devices.

## Getting Started

Expand Down
20 changes: 10 additions & 10 deletions quickstart/cpp/linux/from-microphone/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# Quickstart: Recognize speech in C++ for Linux (Ubuntu 16.04, Ubuntu 18.04, Debian 9, RHEL 8, CentOS 8)
# Quickstart: Recognize speech in C++ for Linux

This sample demonstrates how to recognize speech with C++ using the Speech SDK for Linux.
See the [accompanying article](https://docs.microsoft.com/azure/cognitive-services/speech-service/quickstarts/speech-to-text-from-microphone?tabs=dotnet%2Cx-android%2Clinux%2Cjava-runtime%2Cwindowsinstall&pivots=programming-language-cpp) on the SDK documentation page for step-by-step instructions.

> **Note:**
> We currently only support [specific Linux distributions and target architectures](https://docs.microsoft.com/azure/cognitive-services/speech-service/speech-sdk?tabs=linux).
## Prerequisites

* A subscription key for the Speech service. See [Try the speech service for free](https://docs.microsoft.com/azure/cognitive-services/speech-service/get-started).
* An Ubuntu 16.04, Ubuntu 18.04, Debian 9, RHEL 8, or CentOS 8 PC with a working microphone.
* On Ubuntu, install these packages to build and run this sample:
* A Linux PC with a working microphone.
* On Ubuntu or Debian, install these packages to build and run this sample:

```sh
sudo apt-get update
sudo apt-get install build-essential libssl1.0.0 libasound2 wget
```

* On Debian 9, install these packages to build and run this sample:

```sh
sudo apt-get update
sudo apt-get install build-essential libssl1.0.2 libasound2 wget
```
* If libssl1.0.0 is not available, install libssl1.0.x (where x is greater than 0) or libssl1.1 instead.

* On RHEL 8 or CentOS 8, install these packages to build and run this sample:
* On RHEL or CentOS, install these packages to build and run this sample:

```sh
sudo yum update
sudo yum groupinstall "Development tools"
sudo yum install alsa-lib openssl wget
```

* See also [how to configure RHEL/CentOS 7 for Speech SDK](https://docs.microsoft.com/azure/cognitive-services/speech-service/how-to-configure-rhel-centos-7).

## Build the sample

* [Download the sample code to your development PC.](/README.md#get-the-samples)
Expand Down
19 changes: 10 additions & 9 deletions quickstart/cpp/linux/text-to-speech/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
# Quickstart: Synthesize speech in C++ for Linux (Ubuntu 16.04, Ubuntu 18.04, Debian 9, RHEL 8, CentOS 8)
# Quickstart: Synthesize speech in C++ for Linux

This sample demonstrates how to synthesize speech with C++ using the Speech SDK for Linux.
See the [accompanying article](https://docs.microsoft.com/azure/cognitive-services/speech-service/quickstarts/text-to-speech-audio-file?tabs=ubuntu%2Cwindowsinstall&pivots=programming-language-cpp) on the SDK documentation page for step-by-step instructions.

> **Note:**
> We currently only support [specific Linux distributions and target architectures](https://docs.microsoft.com/azure/cognitive-services/speech-service/speech-sdk?tabs=linux).
## Prerequisites

* A subscription key for the Speech service. See [Try the speech service for free](https://docs.microsoft.com/azure/cognitive-services/speech-service/get-started).
* An Ubuntu 16.04, Ubuntu 18.04, Debian 9, RHEL 8, or CentOS 8 PC with a working speaker or headset.
* On Ubuntu, install these packages to build and run this sample:
* A Linux PC with a working speaker or headset.
* On Ubuntu or Debian, install these packages to build and run this sample:

```sh
sudo apt-get update
sudo apt-get install build-essential libssl1.0.0 libasound2 wget
```
* On Debian 9, install these packages to build and run this sample:

```sh
sudo apt-get update
sudo apt-get install build-essential libssl1.0.2 libasound2 wget
```
* If libssl1.0.0 is not available, install libssl1.0.x (where x is greater than 0) or libssl1.1 instead.

* On RHEL 8 or CentOS 8, install these packages to build and run this sample:
* On RHEL or CentOS, install these packages to build and run this sample:

```sh
sudo yum update
sudo yum groupinstall "Development tools"
sudo yum install alsa-lib openssl wget
```

* See also [how to configure RHEL/CentOS 7 for Speech SDK](https://docs.microsoft.com/azure/cognitive-services/speech-service/how-to-configure-rhel-centos-7).

## Build the sample

* [Download the sample code to your development PC.](/README.md#get-the-samples)
Expand Down
20 changes: 10 additions & 10 deletions quickstart/cpp/windows/from-blob/helloworld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void to_json(nlohmann::json& j, const Transcription& t) {
{ "recordingsurl",t.recordingsUrl },
{ "resultUrls", t.resultsUrls},
{ "status", t.status},
{ "statusmessage", t.statusMessage}
{ "statusMessage", t.statusMessage},
};
};

Expand All @@ -117,7 +117,7 @@ void from_json(const nlohmann::json& j, Transcription& t) {
j.at("recordingsUrl").get_to(t.recordingsUrl);
t.resultsUrls = j.at("resultsUrls").get<map<string, string>>();
j.at("status").get_to(t.status);
j.at("statusMessage").get_to(t.statusMessage);
t.statusMessage = j.value("statusMessage", "");
}
class Result
{
Expand Down Expand Up @@ -233,19 +233,19 @@ void recognizeSpeech()
}

auto body = statusResponse.extract_string().get();
nlohmann::json statusJSON = nlohmann::json::parse(body);
Transcription transcriptonStatus = statusJSON;
auto statusJSON = nlohmann::json::parse(body);
Transcription transcriptionStatus = statusJSON;

if (!_stricmp(transcriptonStatus.status.c_str(), "Failed"))
if (!_stricmp(transcriptionStatus.status.c_str(), "Failed"))
{
completed = true;
cout << "Transcription has failed " << transcriptonStatus.statusMessage << endl;
cout << "Transcription has failed " << transcriptionStatus.statusMessage << endl;
}
else if (!_stricmp(transcriptonStatus.status.c_str(), "Succeeded"))
else if (!_stricmp(transcriptionStatus.status.c_str(), "Succeeded"))
{
completed = true;
cout << "Success!" << endl;
string result = transcriptonStatus.resultsUrls["channel_0"];
string result = transcriptionStatus.resultsUrls["channel_0"];
cout << "Transcription has completed. Results are at " << result << endl;
cout << "Fetching results" << endl;

Expand Down Expand Up @@ -283,11 +283,11 @@ void recognizeSpeech()
}
}
}
else if (!_stricmp(transcriptonStatus.status.c_str(), "Running"))
else if (!_stricmp(transcriptionStatus.status.c_str(), "Running"))
{
cout << "Transcription is running." << endl;
}
else if (!_stricmp(transcriptonStatus.status.c_str(), "NotStarted"))
else if (!_stricmp(transcriptionStatus.status.c_str(), "NotStarted"))
{
cout << "Transcription has not started." << endl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<!-- N.B. the .targets extensions must be spelled out here -->
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CognitiveServices.Speech" version="1.13.0" targetFramework="native" />
<package id="Microsoft.CognitiveServices.Speech" version="1.14.0" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<!-- N.B. the .targets extensions must be spelled out here -->
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CognitiveServices.Speech" version="1.13.0" targetFramework="native" />
<package id="Microsoft.CognitiveServices.Speech" version="1.14.0" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<!-- N.B. the .targets extensions must be spelled out here -->
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CognitiveServices.Speech" version="1.13.0" targetFramework="native" />
<package id="Microsoft.CognitiveServices.Speech" version="1.14.0" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CognitiveServices.Speech" version="1.13.0" targetFramework="native" />
<package id="Microsoft.CognitiveServices.Speech" version="1.14.0" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<!-- N.B. the .targets extensions must be spelled out here -->
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CognitiveServices.Speech" version="1.13.0" targetFramework="native" />
<package id="Microsoft.CognitiveServices.Speech" version="1.14.0" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<!-- N.B. the .targets extensions must be spelled out here -->
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.13.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.14.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.CognitiveServices.Speech" version="1.13.0" targetFramework="native" />
<package id="Microsoft.CognitiveServices.Speech" version="1.14.0" targetFramework="native" />
</packages>
Loading

0 comments on commit b425737

Please sign in to comment.