Skip to content

Commit

Permalink
merge all public_samples updates for the 1.7.0 release. (#383)
Browse files Browse the repository at this point in the history
* merge all public_samples updates for the 1.7.0 release.

* Update refferenced SDK revsion in new samples.

* manually fix some missed 1.6 to 1.7 SDK version updates to the public samples.
  • Loading branch information
BrianMouncer authored Sep 25, 2019
1 parent e095701 commit 1d1b13a
Show file tree
Hide file tree
Showing 343 changed files with 20,195 additions and 280 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ proguard-rules.pro text

*.appxmanifest text
*.asset text
*.axml text
*.bat text
*.config text
*.cpp text
Expand Down Expand Up @@ -52,6 +53,7 @@ proguard-rules.pro text

# Binary extensions:
*.jar binary
*.mp3 binary
*.pfx binary
*.png binary
*.wav binary
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ This project hosts the **samples** for the Microsoft Cognitive Services Speech S

Please check [here](https://aka.ms/csspeech/whatsnew) for release notes and older releases.

* Speech SDK Release 1.7.0

September 2019 we released version 1.7.0 of the Speech SDK

* Speech SDK Release 1.6.0

June 2019 we released version 1.6.0 of the Speech SDK.
Expand All @@ -49,7 +53,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 (1.7.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.

## Getting Started

Expand Down Expand Up @@ -119,6 +123,14 @@ If you want to build them from scratch, please follow the articles in the Quicks
| [Quickstart C# .NET for Windows](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/text-to-speech/csharp-dotnet-windows/) | Windows | Demonstrates one-shot speech synthesis to the default speaker. |
| [Quickstart C# UWP for Windows](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/text-to-speech/csharp-uwp/) | Windows | Demonstrates one-shot speech synthesis to the default speaker. |
| [Quickstart C# .NET Core](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/text-to-speech/csharp-dotnetcore/) | Windows, Linux | Demonstrates one-shot speech synthesis to the default speaker. |
| [Quickstart for C# Unity (Windows or Android)](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/text-to-speech/csharp-unity/) | Windows, Android | Demonstrates one-shot speech synthesis to a synthesis result and then rendering to the default speaker. |
| [Quickstart for Android](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/text-to-speech/java-android/) | Android | Demonstrates one-shot speech synthesis to the default speaker. |
| [Quickstart Java JRE](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/text-to-speech/java-jre/) | Windows, Linux, macOS | Demonstrates one-shot speech synthesis to the default speaker. |
| [Quickstart Python](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/text-to-speech/python/) | Windows, Linux, macOS | Demonstrates one-shot speech synthesis to the default speaker. |
| [Quickstart Objective-C](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/text-to-speech/objectivec-ios/) | iOS | Demonstrates one-shot speech synthesis to a synthesis result and then rendering to the default speaker. |
| [Quickstart Swift](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/text-to-speech/swift-ios/) | iOS | Demonstrates one-shot speech synthesis to the default speaker. |
| [Quickstart Objective-C](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/text-to-speech/objectivec-macos/) | macOS | Demonstrates one-shot speech synthesis to the default speaker. |
| [Quickstart Swift](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/text-to-speech/swift-macos/) | macOS | Demonstrates one-shot speech synthesis to the default speaker. |

### Voice-first virtual assistants quickstarts

Expand All @@ -141,8 +153,8 @@ The following samples demonstrate additional capabilities of the Speech SDK, suc
| [C++ Speech Recognition from MP3/Opus file (Linux only)](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/cpp/linux/compressed-audio-input/) | Linux | Demonstrates speech recognition from an MP3/Opus file |
| [C# Console app for .NET Framework on Windows](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/csharp/dotnet-windows/console/) | Windows | Demonstrates speech recognition, speech synthesis, intent recognition, and translation |
| [C# Console app for .NET Core (Windows or Linux)](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/csharp/dotnetcore/console/) | Windows, Linux, macOS | Demonstrates speech recognition, speech synthesis, intent recognition, and translation |
| [Java Console app for JRE](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/java/jre/console/) | Windows, Linux, macOS | Demonstrates speech recognition, intent recognition, and translation |
| [Python Console app](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/python/console/) | Windows, Linux, macOS | Demonstrates speech recognition, intent recognition, and translation |
| [Java Console app for JRE](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/java/jre/console/) | Windows, Linux, macOS | Demonstrates speech recognition, speech synthesis, intent recognition, and translation |
| [Python Console app](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/python/console/) | Windows, Linux, macOS | Demonstrates speech recognition, speech synthesis, intent recognition, and translation |
| [Speech-to-text WPF sample for .NET Framework on Windows](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/csharp/dotnet-windows/speechtotext-wpf/) | Windows | Demonstrates speech recognition |
| [Translation WPF sample for .NET Framework on Windows](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/csharp/dotnet-windows/translation-wpf/) | Windows | Demonstrates translation |
| [Speech-to-text UWP sample](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/csharp/uwp/speechtotext-uwp/) | Windows | Demonstrates speech recognition |
Expand All @@ -152,12 +164,11 @@ The following samples demonstrate additional capabilities of the Speech SDK, suc
| [Speech recognition and translation sample using JavaScript and Node.js](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/js/node/) | Node.js | Demonstrates speech recognition, intent recognition, and translation |
| [Speech recognition sample for iOS using a connection object](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/objective-c/ios/README.md#connection-object-sample) | iOS | Demonstrates speech recognition |
| [Extended speech recognition sample for iOS](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/objective-c/ios/README.md#example-app-with-various-samples) | iOS | Demonstrates speech recognition using streams etc.|
| [Speech synthesis sample for iOS](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/objective-c/ios/README.md#example-app-with-various-samples) | iOS | Demonstrates speech synthesis using streams etc.|
| [C# UWP DialogServiceConnector sample for Windows](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/csharp/uwp/virtualassistant-uwp/) | Windows | Demonstrates speech recognition through the DialogServiceConnector and receiving activity responses. |
| [C# Unity sample for Windows or Android](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/unity/speechrecognizer/) | Windows, Android | Demonstrates speech recognition, intent recognition, and translation for Unity |
| [C# Unity SpeechBotConnector sample for Windows or Android](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/csharp/unity/VirtualAssistantPreview/) | Windows, Android | Demonstrates speech recognition through the SpeechBotConnector and receiving activity responses. |



Samples for using the Speech Service REST API (no Speech SDK installation required):

| Sample | Description |
Expand Down
11 changes: 7 additions & 4 deletions quickstart/cpp-linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@

SPEECHSDK_ROOT:=/change/to/point/to/extracted/SpeechSDK

CHECK_FOR_SPEECHSDK := $(shell test -f $(SPEECHSDK_ROOT)/lib/x64/libMicrosoft.CognitiveServices.Speech.core.so && echo Success)
# If you'd like to build for
# - Linux x86 (32-bit), replace "x64" below with "x86".
# - Linux ARM64 (64-bit), replace "x64" below with "arm64".
TARGET_PLATFORM:=x64

CHECK_FOR_SPEECHSDK := $(shell test -f $(SPEECHSDK_ROOT)/lib/$(TARGET_PLATFORM)/libMicrosoft.CognitiveServices.Speech.core.so && echo Success)
ifneq ("$(CHECK_FOR_SPEECHSDK)","Success")
$(error Please set SPEECHSDK_ROOT to point to your extracted Speech SDK, $$SPEECHSDK_ROOT/lib/x64/libMicrosoft.CognitiveServices.Speech.core.so should exist.)
$(error Please set SPEECHSDK_ROOT to point to your extracted Speech SDK, $$SPEECHSDK_ROOT/lib/$(TARGET_PLATFORM)/libMicrosoft.CognitiveServices.Speech.core.so should exist.)
endif

# If you'd like to build for 32-bit Linux, replace "x64" in the next line with "x86".
TARGET_PLATFORM:=x64
LIBPATH:=$(SPEECHSDK_ROOT)/lib/$(TARGET_PLATFORM)

INCPATH:=$(SPEECHSDK_ROOT)/include/cxx_api $(SPEECHSDK_ROOT)/include/c_api
Expand Down
9 changes: 8 additions & 1 deletion quickstart/cpp-linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ See the [accompanying article](https://docs.microsoft.com/azure/cognitive-servic
* Navigate to the directory of this sample
* Edit the file `Makefile`:
* In the line `SPEECHSDK_ROOT:=/change/to/point/to/extracted/SpeechSDK` change the right-hand side to point to the location of your extract Speech SDK for Linux.
* If you are running on 32-bit Linux, change the line `TARGET_PLATFORM:=x64` to `TARGET_PLATFORM:=x86`.
* If you are running on Linux x86 (32-bit), change the line `TARGET_PLATFORM:=x64` to `TARGET_PLATFORM:=x86`.
* If you are running on Linux ARM64 (64-bit), change the line `TARGET_PLATFORM:=x64` to `TARGET_PLATFORM:=arm64`.
* Edit the `helloworld.cpp` source:
* Replace the string `YourSubscriptionKey` with your own subscription key.
* Replace the string `YourServiceRegion` with the service region of your subscription.
Expand All @@ -60,6 +61,12 @@ To run the sample, you'll need to configure the loader's library path to point t
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SPEECHSDK_ROOT/lib/x86"
```

* On an ARM64 machine, run:

```sh
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SPEECHSDK_ROOT/lib/arm64"
```

Run the application:

```sh
Expand Down
4 changes: 2 additions & 2 deletions quickstart/cpp-windows/helloworld/helloworld.vcxproj
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.6.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.6.0\build\native\Microsoft.CognitiveServices.Speech.targets')" />
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.7.0\build\native\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.7.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.6.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.6.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.7.0\build\native\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.7.0\build\native\Microsoft.CognitiveServices.Speech.targets'))" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion quickstart/cpp-windows/helloworld/packages.config
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.6.0" targetFramework="native" />
<package id="Microsoft.CognitiveServices.Speech" version="1.7.0" targetFramework="native" />
</packages>
2 changes: 1 addition & 1 deletion quickstart/csharp-dotnet-windows/helloworld/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static async Task RecognizeSpeechAsync()
static void Main()
{
RecognizeSpeechAsync().Wait();
Console.WriteLine("Please press a key to continue.");
Console.WriteLine("Please press <Return> to continue.");
Console.ReadLine();
}
}
Expand Down
8 changes: 4 additions & 4 deletions quickstart/csharp-dotnet-windows/helloworld/helloworld.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CognitiveServices.Speech.csharp, Version=1.6.0.28, Culture=neutral, PublicKeyToken=d2e6dcccb609e663, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CognitiveServices.Speech.1.6.0\lib\net461\Microsoft.CognitiveServices.Speech.csharp.dll</HintPath>
<Reference Include="Microsoft.CognitiveServices.Speech.csharp, Version=1.7.0.28, Culture=neutral, PublicKeyToken=d2e6dcccb609e663, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CognitiveServices.Speech.1.7.0\lib\net461\Microsoft.CognitiveServices.Speech.csharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -96,12 +96,12 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.6.0\build\net461\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.6.0\build\net461\Microsoft.CognitiveServices.Speech.targets')" />
<Import Project="..\packages\Microsoft.CognitiveServices.Speech.1.7.0\build\net461\Microsoft.CognitiveServices.Speech.targets" Condition="Exists('..\packages\Microsoft.CognitiveServices.Speech.1.7.0\build\net461\Microsoft.CognitiveServices.Speech.targets')" />
<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.6.0\build\net461\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.6.0\build\net461\Microsoft.CognitiveServices.Speech.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.CognitiveServices.Speech.1.7.0\build\net461\Microsoft.CognitiveServices.Speech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CognitiveServices.Speech.1.7.0\build\net461\Microsoft.CognitiveServices.Speech.targets'))" />
</Target>
<!-- N.B. the .targets extensions must be spelled out here -->
</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.6.0" targetFramework="net461" />
<package id="Microsoft.CognitiveServices.Speech" version="1.7.0" targetFramework="net461" />
</packages>
2 changes: 1 addition & 1 deletion quickstart/csharp-dotnetcore/helloworld/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static async Task RecognizeSpeechAsync()
static void Main()
{
RecognizeSpeechAsync().Wait();
Console.WriteLine("Please press a key to continue.");
Console.WriteLine("Please press <Return> to continue.");
Console.ReadLine();
}
}
Expand Down
2 changes: 1 addition & 1 deletion quickstart/csharp-dotnetcore/helloworld/helloworld.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CognitiveServices.Speech" Version="1.6.0" />
<PackageReference Include="Microsoft.CognitiveServices.Speech" Version="1.7.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion quickstart/csharp-unity/Assets/Scenes/HelloWorld.unity
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 170076734}
m_IndirectSpecularColor: {r: 0.44657844, g: 0.49641222, b: 0.57481694, a: 1}
m_IndirectSpecularColor: {r: 0.44657826, g: 0.49641263, b: 0.57481676, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
Expand Down
18 changes: 16 additions & 2 deletions quickstart/csharp-unity/Assets/Scripts/HelloWorld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#if PLATFORM_ANDROID
using UnityEngine.Android;
#endif
#if PLATFORM_IOS
using UnityEngine.iOS;
using System.Collections;
#endif

public class HelloWorld : MonoBehaviour
{
Expand All @@ -22,7 +26,7 @@ public class HelloWorld : MonoBehaviour

private bool micPermissionGranted = false;

#if PLATFORM_ANDROID
#if PLATFORM_ANDROID || PLATFORM_IOS
// Required to manifest microphone permission, cf.
// https://docs.unity3d.com/Manual/android-manifest.html
private Microphone mic;
Expand Down Expand Up @@ -88,7 +92,6 @@ void Start()
else
{
// Continue with normal initialization, Text and Button objects are present.

#if PLATFORM_ANDROID
// Request to use the microphone, cf.
// https://docs.unity3d.com/Manual/android-RequestingPermissions.html
Expand All @@ -97,6 +100,11 @@ void Start()
{
Permission.RequestUserPermission(Permission.Microphone);
}
#elif PLATFORM_IOS
if (!Application.HasUserAuthorization(UserAuthorization.Microphone))
{
Application.RequestUserAuthorization(UserAuthorization.Microphone);
}
#else
micPermissionGranted = true;
message = "Click button to recognize speech";
Expand All @@ -113,6 +121,12 @@ void Update()
micPermissionGranted = true;
message = "Click button to recognize speech";
}
#elif PLATFORM_IOS
if (!micPermissionGranted && Application.HasUserAuthorization(UserAuthorization.Microphone))
{
micPermissionGranted = true;
message = "Click button to recognize speech";
}
#endif

lock (threadLocker)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ GraphicsSettings:
m_AlbedoSwatchInfos: []
m_LightsUseLinearIntensity: 0
m_LightsUseColorTemperature: 0
m_LogWhenShaderIsCompiled: 0
Loading

0 comments on commit 1d1b13a

Please sign in to comment.