diff --git a/Android/.gitignore b/Android/.gitignore deleted file mode 100644 index fe99a322..00000000 --- a/Android/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -# Generated files -bin/ -gen/ -out/ -build/ - -# OS specific files -.DS_Store - -# IntelliJ / Android studio configuration files -.idea/ -*.iml - -# Gradle generated files -.gradle/ - -# Local config (e.g. sdk path) -local.properties \ No newline at end of file diff --git a/Android/README.md b/Android/README.md deleted file mode 100644 index 93efe24e..00000000 --- a/Android/README.md +++ /dev/null @@ -1,56 +0,0 @@ -The client library -================== - -The Text To Speech client library is a client library for Microsoft Cognitive Services (formerly Project Oxford) -Text To Speech REST APIs. - -The sample ----------- - -This sample is an Android application to demonstrate the use of Microsoft Cognitive Services (formerly Project Oxford) -Text To Speech API. - -Requirements ------------- - -* Android OS must be Android 4.1 or higher (API Level 16 or higher) -* The speech client library contains native code. To use this sample in an emulator, make sure that your build variant matches the architecture (x86 or arm) of your emulator. However, due to the need of audio, using a physical device is recommended. - -Build the sample ----------------- - -1. First, you must obtain a Speech API subscription key by following instructions in [Microsoft Cognitive Services subscription](https://www.microsoft.com/cognitive-services/en-us/sign-up). - -1. Start Android Studio and open project by `File > Import Project`. Choose subfolder `Sample` in the `Android` folder. - -1. In Android Studio -\> `Project` panel -\> `Android` view, open file `app/res/values/strings.xml`, and find the line `Please_add_the_subscription_key_here;`. Replace the `Please_add_the_subscription_key_here` value with your subscription key string from the first step. If you cannot find the file `string.xml`, it is in folder `Sample\app\src\main\res\values\string.xml`. - -1. There are two more values to modify. The endpoint of authentication or synthesis must match the subscription key you use. Check them out respectively. Refer to HTTP samples if necessary. - * `Sample/speechsdk/src/main/java/com/microsoft/speech/tts/Authentication.java` for `AccessTokenUri = "https://api.cognitive.microsoft.com/sts/v1.0/issueToken";` - * `Sample/speechsdk/src/main/java/com/microsoft/speech/tts/TtsServiceClient.java` for `m_serviceUri = "https://speech.platform.bing.com/synthesize";` - -1. In Android Studio, select menu `Build > Make Project` to build the sample, and `Run` to launch this sample app. - -Run the sample --------------- - -In Android Studio, select menu "Run", and "Run app" to launch this sample app. - -![Sample Running](SampleScreenshots/SampleRunning1.png) - -Contributing ------------- - -We welcome contributions and are always looking for new SDKs, input, and suggestions. Feel free to file issues on the repo and we'll address them as we can. You can also learn more about how you can help on the [Contribution Rules & Guidelines](/CONTRIBUTING.md). - -For questions, feedback, or suggestions about Microsoft Cognitive Services, feel free to reach out to us directly. - -* [Cognitive Services UserVoice Forum](https://cognitive.uservoice.com) - -License -------- - -All Microsoft Cognitive Services SDKs and samples are licensed with the MIT License. For more details, see -[LICENSE](). - -Sample images are licensed separately, please refer to [LICENSE-IMAGE](/LICENSE-IMAGE.md). diff --git a/Android/Sample/.gitignore b/Android/Sample/.gitignore deleted file mode 100644 index afbdab33..00000000 --- a/Android/Sample/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.gradle -/local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build diff --git a/Android/Sample/app/.gitignore b/Android/Sample/app/.gitignore deleted file mode 100644 index 796b96d1..00000000 --- a/Android/Sample/app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/Android/Sample/app/build.gradle b/Android/Sample/app/build.gradle deleted file mode 100644 index 15f53d82..00000000 --- a/Android/Sample/app/build.gradle +++ /dev/null @@ -1,33 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 21 - buildToolsVersion '21.1.2' - - defaultConfig { - applicationId "com.microsoft.sdksample" - minSdkVersion 15 - targetSdkVersion 22 - versionCode 1 - versionName "1.0" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -repositories { - flatDir { - dirs 'libs' - } -} - -dependencies { - releaseCompile(name: 'speechsdk', ext: 'aar') - debugCompile project(path: ':speechsdk') - - compile 'com.android.support:appcompat-v7:22.1.0' -} diff --git a/Android/Sample/app/libs/speechsdk.aar b/Android/Sample/app/libs/speechsdk.aar deleted file mode 100644 index 7a4539bb..00000000 Binary files a/Android/Sample/app/libs/speechsdk.aar and /dev/null differ diff --git a/Android/Sample/app/proguard-rules.pro b/Android/Sample/app/proguard-rules.pro deleted file mode 100644 index c931b1e2..00000000 --- a/Android/Sample/app/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in C:\Users\jinzl\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/Android/Sample/app/src/main/AndroidManifest.xml b/Android/Sample/app/src/main/AndroidManifest.xml deleted file mode 100644 index 34020d1b..00000000 --- a/Android/Sample/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - diff --git a/Android/Sample/app/src/main/java/com/microsoft/sdksample/MainActivity.java b/Android/Sample/app/src/main/java/com/microsoft/sdksample/MainActivity.java deleted file mode 100644 index 915ee63b..00000000 --- a/Android/Sample/app/src/main/java/com/microsoft/sdksample/MainActivity.java +++ /dev/null @@ -1,97 +0,0 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. -// -// Microsoft Cognitive Services (formerly Project Oxford): https://www.microsoft.com/cognitive-services -// -// Microsoft Cognitive Services (formerly Project Oxford) GitHub: -// https://github.com/Microsoft/Cognitive-Speech-TTS -// -// Copyright (c) Microsoft Corporation -// All rights reserved. -// -// MIT License: -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -package com.microsoft.sdksample; - -import android.app.AlertDialog; -import android.os.Bundle; -import android.support.v7.app.ActionBarActivity; -import android.view.View; -import android.widget.Toast; - -import com.microsoft.speech.tts.Synthesizer; -import com.microsoft.speech.tts.Voice; - -public class MainActivity extends ActionBarActivity { - // Note: Sign up at http://www.projectoxford.ai for the client credentials. - private Synthesizer m_syn; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - if (getString(R.string.api_key).startsWith("Please")) { - new AlertDialog.Builder(this) - .setTitle(getString(R.string.add_subscription_key_tip_title)) - .setMessage(getString(R.string.add_subscription_key_tip)) - .setCancelable(false) - .show(); - } else { - - if (m_syn == null) { - // Create Text To Speech Synthesizer. - m_syn = new Synthesizer(getString(R.string.api_key)); - } - - Toast.makeText(this, "If the wave is not played, please see the log for more information.", Toast.LENGTH_LONG).show(); - - m_syn.SetServiceStrategy(Synthesizer.ServiceStrategy.AlwaysService); - - Voice v = new Voice("en-US", "Microsoft Server Speech Text to Speech Voice (en-US, ZiraRUS)", Voice.Gender.Female, true); - //Voice v = new Voice("zh-CN", "Microsoft Server Speech Text to Speech Voice (zh-CN, HuihuiRUS)", Voice.Gender.Female, true); - m_syn.SetVoice(v, null); - - // Use a string for speech. - m_syn.SpeakToAudio(getString(R.string.tts_text)); - - // Use SSML for speech. - String text = "You can also use SSML markup for text to speech."; - m_syn.SpeakSSMLToAudio(text); - - findViewById(R.id.stop_btn).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - m_syn.stopSound(); - } - }); - - findViewById(R.id.play_btn).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - m_syn.SpeakToAudio(getString(R.string.tts_text)); - } - }); - } - } -} diff --git a/Android/Sample/app/src/main/res/layout/activity_main.xml b/Android/Sample/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index feb91410..00000000 --- a/Android/Sample/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - -