Code Monkey home page Code Monkey logo

azure-samples / cognitive-speech-tts Goto Github PK

View Code? Open in Web Editor NEW
840.0 90.0 498.0 137.95 MB

Microsoft Text-to-Speech API sample code in several languages, part of Cognitive Services.

Home Page: https://azure.microsoft.com/en-us/services/cognitive-services/text-to-speech/

License: Other

Java 14.08% C# 48.60% JavaScript 9.67% PHP 2.41% Python 5.12% Ruby 0.51% Swift 3.18% Makefile 0.31% M4 1.51% Shell 0.05% Dockerfile 0.33% C++ 10.13% Go 0.44% HTML 2.20% CSS 1.46%
tts text-to-speech speech-synthesis text-to-wave text-to-mp3 neuraltts transformer e2etts custom-neural-voice azure-tts

cognitive-speech-tts's Introduction

Azure Cognitive Service TTS Samples

Microsoft Text to speech service now is officially supported by Speech SDK now. It is recommended way to use TTS in your service or apps. The REST API samples are just provided as referrence when SDK is not supported on the desired platform.

Below are latest updates from Azure TTS. It is updated regularly.

Azure TTS Discord Channels

A space for developers and enthusiasts to collaborate and share feedbacks to Azure TTS. Join Discord

Azure Cognitive Service TTS Customer Story

Azure Cognitive Service TTS Blog and News

Here lists the Azure Cognitive TTS product blog, customer stories and Microsoft TTS research news etc.

Azure Cognitive Service TTS Links

Contributing

We welcome contributions. Feel free to file issues and pull requests on the repo and we'll address them as we can. Learn more about how you can help on our Contribution Rules & Guidelines.

You can reach out to us anytime with questions and suggestions using our communities below:

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

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.

Developer Code of Conduct

Developers using Cognitive Services, including this client library & sample, are expected to follow the “Developer Code of Conduct for Microsoft Cognitive Services”, found at http://go.microsoft.com/fwlink/?LinkId=698895.

cognitive-speech-tts's People

Contributors

boltomli avatar cherrycaol avatar dapengli2016 avatar delfu avatar dependabot[bot] avatar erhopf avatar felixhao28 avatar forrestgumb avatar hepower avatar jasonvomsft avatar jiajzhan avatar kimkevin avatar lightfrenzy avatar ms-feizhao avatar namujumd avatar neoguo0601 avatar niuzheng168 avatar qingshengh avatar sally-baolian avatar shazh-ms avatar szhaomsft avatar tianhzhao avatar xiaozhouz avatar xym4869 avatar yeya avatar yeyuanh avatar yinhew avatar yukozh avatar yulin-li avatar zhifzhan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cognitive-speech-tts's Issues

Python Example does not work if you use own Subscription Key

When I try to use the Python example, but replace api_key with my own from the portal, I am able to successfully get a token; however, I get a 401 when I call "westus.tts.speech.microsoft.com"

headers = {"Ocp-Apim-Subscription-Key": api_key}
pi@raspberrypi3:~/git/robo-clippy $ python3 TTSSample.py <removed> 'hi i am robo clippy'


Connect to server to get the Access Token
200 OK
Access Token:  <removed>
b'<?xml version="1.0" ?>\n<speak version="1.0" xml:lang="en-us">\n   <voice name="Microsoft Server Speech Text to Speech Voice (en-US, Guy24KRUS)" xml:gender="Male" xml:lang="en-US">hi i am robo clippy</voice>\n</speak>\n'

Connect to server to synthesize the wave
401 Unauthorized

Connection cleanup in Authentication class of SpeechSDK

The best practice is to have finally block to check status of the connection and close it.

`//webRequest.disconnect();

        this.accessToken = strBuffer.toString();

    }catch (Exception e){
        Log.e(LOG_TAG, "Exception error", e);
    }
    finally {
        if (webRequest != null) {
            webRequest.disconnect();
        }
    }`

Text-to-speech API returns 401 Unauthorized

I'm trying to use the Cognitive Services text-to-speech API, but no matter what I try, I get a 401 Unauthorized response.

I've created a Cognitive Services resource on my subscription in the West Europe region. Type is All Cognitive Services, status is active. I downloaded the CSharp sample and entered the west europe URLs and my cognitive services subscription key into the code. When I run the sample, the access token is retrieved just fine, but the text-to-speech request returns 401.

Token URL: https://westeurope.api.cognitive.microsoft.com/sts/v1.0/issueToken
Service URL: https://westeurope.tts.speech.microsoft.com/cognitiveservices/v1

I've checked that the URLs are correct, I'm using the same region in both and the same one as the created resource. I went throught the troubleshooting page (https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/troubleshooting) and got the same 401 issue. I tried running the TTS request from Postman. I've tried both Key1 and Key2 from the portal, and tried to regenerate a key.

I've decoded the access token and it seems like it has pretty much the right stuff in it, as far as I can tell. The only weird thing is, the exp field is a string and not a number (incorrect for a JWT). Could that be a bug in the auth system that is causing this error or am I doing something wrong?

Request

POST https://westeurope.tts.speech.microsoft.com/cognitiveservices/v1 HTTP/1.1
Authorization: Bearer <access-token>
User-Agent: TestApi
X-Microsoft-OutputFormat: audio-16khz-64kbitrate-mono-mp3
Content-Type: application/ssml+xml
Host: westeurope.tts.speech.microsoft.com
Content-Length: 209

<speak version="1.0" xml:lang="fi-FI">
  <voice name="Microsoft Server Speech Text to Speech Voice (fi-FI, HeidiRUS)" xml:lang="fi-FI">Hei, muistathan suorittaa päivän harjoitteet ajoissa.</voice>
</speak>

Response

HTTP/1.1 401 Unauthorized
X-MSEdge-Ref: Ref A: AD369D30DDB7466B8A77086554F9DC46 Ref B: HEL02EDGE0112 Ref C: 2018-12-10T13:03:43Z
Date: Mon, 10 Dec 2018 13:03:42 GMT
Content-Length: 0

TTS not working on Azure hosting

I have created an ASP .Net MVC App and I implemented C# TTS example to my application. TTS working fine when my application running on the local machine. But after deploying applications on Azure environment It's stopped working. Can anybody help me to find the solution. Any other way to implement TTS in ASP .NET MVC App.

BOT integration

Hi,

We are trying this with MS BOT Builder.

Can you help how can we send "_data" (Wave date) to user as File where he can play it. ?

How to get app id and client id for TTS ?

I have integrated your TTSClient.cs in my mvc project, in localhost it works fine. But i have hosted in our server IIS and generated https:// public url in that text-to-speech is not working.
Is need to generate app id and client id unique for my application ? if so and how do get that ?
please suggest me on this...

Error while running NodeJS HTTP client example

Hey , I am getting 2 types of errors.

  1. Illegal instruction : 4
  2. null < Buffer >

There is no references to these errors. Can you guys help me ?
I am using the example file included in the project

TTSService.Synthesize takes a long time to return

Hi. I am using Java to call TTSService.Synthesize. For some reason takes a long time for the service to come back with the MP3. What AudioOutputFormat should I use to make the smallest mp3 and hopefully stream it to the client?

Thanks.

Chris

Error on Windows 10

c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS>npm install
npm WARN NodeJS No repository field.
npm WARN NodeJS No license field.

up to date in 0.479s

c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS>node TTSSample.js
c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\node_modules\bindings\bindings.js:96
throw err
^

Error: Could not locate the bindings file. Tried:
→ c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\node_modules\speaker\build\binding.node
→ c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\node_modules\speaker\build\Debug\binding.node
→ c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\node_modules\speaker\build\Release\binding.node
→ c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\node_modules\speaker\out\Debug\binding.node
→ c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\node_modules\speaker\Debug\binding.node
→ c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\node_modules\speaker\out\Release\binding.node
→ c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\node_modules\speaker\Release\binding.node
→ c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\node_modules\speaker\build\default\binding.node
→ c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\node_modules\speaker\compiled\8.11.1\win32\x64\binding.node
at bindings (c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\node_modules\bindings\bindings.js:93:9)
at Object. (c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\node_modules\speaker\index.js:8:34)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (c:\Solutions\Cognitive-Speech-TTS\Samples-Http\NodeJS\TTSService.js:12:15)

How know when the speak is finished?

Hi!

Congratulation, but I have one questions.

How do I know when the Synthesizer is finished? For example, when the Synthesizer finish, I change to other app,

It needs to know when Synthesizer is DONE/FINISHED to run another things.

Thanks

What are X-Search-AppId and X-Search-ClientID?

I would like to integrate Azure TTS into my project but I can run sample project only with demo API key. When using this sdk into real project with subscribed API key, the API always return 403. I dived deep into sdk project and see these values, so where is it from and how to get them?

urlConnection.setRequestProperty("X-Search-AppId", "07D3234E49CE426DAA29772419F436CA");

urlConnection.setRequestProperty("X-Search-ClientID", "1ECFAE91408841A480F00935DC390960");

No wave is heard after pressing Play

Application is built in latest Visual Studio and is ran on Xiaomi Redmi 4 Pro.
Problem: No wave is heard after pressing PLAY .

Logcat:

I/Choreographer: Skipped 225 frames! The application may be doing too much work on its main thread.
E/Authentication: Exception error
java.io.FileNotFoundException: https://api.cognitive.microsoft.com/sts/v1.0/issueToken
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:238)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
at com.microsoft.speech.tts.Authentication.HttpPost(Authentication.java:131)
at com.microsoft.speech.tts.Authentication.RenewAccessToken(Authentication.java:97)
at com.microsoft.speech.tts.Authentication.access$000(Authentication.java:51)
at com.microsoft.speech.tts.Authentication$2.run(Authentication.java:84)
at java.util.Timer$TimerImpl.run(Timer.java:284)

Also in the begining it shows:

W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --non-interactive --runtime-arg -Xms64m --runtime-arg -Xmx512m -j4 --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.microsoft.sdksample-2/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm64/data@[email protected]@[email protected]) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --non-interactive --runtime-arg -Xms64m --runtime-arg -Xmx512m -j4 --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.microsoft.sdksample-2/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/arm64/data@[email protected]@[email protected]) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --non-interactive --runtime-arg -Xms64m --runtime-arg -Xmx512m -j4 --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.microsoft.sdksample-2/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/arm64/data@[email protected]@[email protected]) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --non-interactive --runtime-arg -Xms64m --runtime-arg -Xmx512m -j4 --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.microsoft.sdksample-2/split_lib_slice_2_apk.apk --oat-file=/data/dalvik-cache/arm64/data@[email protected]@[email protected]) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --non-interactive --runtime-arg -Xms64m --runtime-arg -Xmx512m -j4 --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.microsoft.sdksample-2/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/arm64/data@[email protected]@[email protected]) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --non-interactive --runtime-arg -Xms64m --runtime-arg -Xmx512m -j4 --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.microsoft.sdksample-2/split_lib_slice_4_apk.apk --oat-file=/data/dalvik-cache/arm64/data@[email protected]@[email protected]) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --non-interactive --runtime-arg -Xms64m --runtime-arg -Xmx512m -j4 --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.microsoft.sdksample-2/split_lib_slice_5_apk.apk --oat-file=/data/dalvik-cache/arm64/data@[email protected]@[email protected]) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --non-interactive --runtime-arg -Xms64m --runtime-arg -Xmx512m -j4 --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.microsoft.sdksample-2/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/arm64/data@[email protected]@[email protected]) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --non-interactive --runtime-arg -Xms64m --runtime-arg -Xmx512m -j4 --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.microsoft.sdksample-2/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/arm64/data@[email protected]@[email protected]) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --non-interactive --runtime-arg -Xms64m --runtime-arg -Xmx512m -j4 --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.microsoft.sdksample-2/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/arm64/data@[email protected]@[email protected]) because non-0 exit status
W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --non-interactive --runtime-arg -Xms64m --runtime-arg -Xmx512m -j4 --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.microsoft.sdksample-2/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/arm64/data@[email protected]@[email protected]) because non-0 exit status
W/System: ClassLoader referenced unknown path: /data/app/com.microsoft.sdksample-2/lib/arm64

Android sample fails silently

android sample for TTS fails silently.

Changing API key, and running the app doesn't do anything. only toasts to check the log if there is no sound, but there is nothing evident at the log

04-06 14:38:43.585 10801-10801/? I/art: Late-enabling -Xcheck:jni
04-06 14:38:43.606 10801-10808/? I/art: Debugger is no longer active
04-06 14:38:43.606 10801-10808/? I/art: Starting a blocking GC Instrumentation
04-06 14:38:43.626 10801-10801/? W/System: ClassLoader referenced unknown path: /data/app/com.microsoft.sdksample-2/lib/arm64
04-06 14:38:43.677 10801-10819/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
04-06 14:38:44.221 10801-10819/? D/Authentication: new Access Token: XXXXXXXXXXXXXX
04-06 14:38:45.764 10801-10856/com.microsoft.sdksample I/Adreno: QUALCOMM build                   : a5b4970, If5818605d9
                                                                 Build Date                       : 10/12/16
                                                                 OpenGL ES Shader Compiler Version: XE031.09.00.04
                                                                 Local Branch                     : N24D
                                                                 Remote Branch                    : 
                                                                 Remote Branch                    : 
                                                                 Reconstruct Branch               : 
04-06 14:38:45.773 10801-10856/com.microsoft.sdksample I/OpenGLRenderer: Initialized EGL, version 1.4
04-06 14:38:45.773 10801-10856/com.microsoft.sdksample D/OpenGLRenderer: Swap behavior 1

how can we add header values to the ssml being generated

In the code you are using: GenerateSsml(inputOptions.Locale, genderValue, inputOptions.VoiceName, inputOptions.Text) to generate the SSML.
How can we add SSML tags to change the voice output via SSML, like speaking rate, pronunciation etc?
Thanks

All of my API keys failed.

It used to work fine a month ago, but I ran the same program and get error today.

I've tried:

  1. Create new keys to test if it works.

  2. Use Node.js and C# example.

I still get error messages running examples

There is "List keys" in Azure activity log every time I run my program.

It looks like any key I created is now invalid.

C# sample error message:

Starting Authtentication
Token: eyJhbGciOiJodHRwOi8vd3d3Lncz......(Token)

Starting TTSSample request code execution.
Response status code: [Unauthorized]
Unable to complete the TTS request: [CognitiveServicesTTS.GenericEventArgs`1[System.Exception]]

Node.js sample error message:
null '{ "statusCode": 401, "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription." }'
(Note that I am using new created keys and still get this message.)

How about add a demo about iOS?

There won't be any problem for anyone who really want to integrate TTS,but it would be more convenient for iOS developer.

License of output audio?

Amazon Polly FAQ says that you are allowed unlimited re-use.

Q. Can I use the service for generating static voice prompts that will be replayed multiple times?
Yes, you can. The service does not restrict this and there are no additional costs for doing so.

I can't find a similar clause for the Bing TTS offering. For my own commercial use, I expect it's allowed.

However, I would like to generate prompts for FreeSWITCH and distribute it (general project is under MPL 1.1) and I'm sure we should have an official notice of what license, if any, covers the the generated audio files.

Thanks!

401 Unauthorized https://speech.platform.bing.com/synthesize

I try to access http://speech.platform.bing.com/synthesize below, it returned "401 Unauthorized", could you give some advise?
Thanks.

> POST /synthesize HTTP/1.1
> Host: speech.platform.bing.com
> Content-Type: application/ssml+xml
> Authorization: Bearer [My token]
> X-Microsoft-OutputFormat: riff-8khz-8bit-mono-mulaw
> X-Search-AppId: 111
> Cache-Control: no-cache
> Postman-Token: abb8200f-e7e4-0fc3-ad29-2f36a9b8466e
> 
> <speak version='1.0' xml:lang='en-US'><voice xml:lang='en-US' xml:gender='Female' name='Microsoft Server Speech Text to Speech Voice (en-US, ZiraRUS)'>Microsoft Bing Voice Output API</voice></speak>

Could not load file or assembly Bond.IO, Version=1.0.0.0...

Dear sirs,

I´am trying to use Bing Speech library service to translate speech to text in my ChatBot, but this error happens in method "RecognizeAsync" of class "SpeechClient".

Could not load file or assembly Bond.IO, Version=1.0.0.0, ... or one of its dependencies. The located assembly manifest definition does not match the assembly reference.

All nuget packages are up to date, as is my Visual Studio 2017 Enterprise.

Thank you for any help.

My project stop getting audios correctly

I have a asp mvc project using text to speech api. This project work for a year without problems.
A few days ago I've noticed that this project stop generating audios. I don't know when exactly this happened.
The api is returning wav audios that I can't play, the file throw an error when I try to play it.
Was there any significant change that I have to make in my project to get this working again?

Android SDK error Non-empty xml:lang attribute must be present

Resolution:
in Synthesizer.java
change
String ssml = "<speak version='1.0' xml:lang='" + m_serviceVoice.lang + "'><voice xml:gender='" + m_serviceVoice.gender + "'";
to
String ssml = "<speak version='1.0' xml:lang='" + m_serviceVoice.lang + "'><voice xml:lang='" + m_serviceVoice.lang + "' xml:gender='" + m_serviceVoice.gender + "'";

API Reference:
<speak version='1.0' xml:lang='en-US'><voice xml:lang='en-US' xml:gender='Female' name='Microsoft Server Speech Text to Speech Voice (en-US, ZiraRUS)'>Microsoft Bing Voice Output API</voice></speak>

no voice is heard

after running the python code there is no voice heard and no errors
***************************output
Connect to server to get the Access Token
200 OK
Access Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ1cm46bXMuY29nbml0aXZlc2VydmljZXMiLCJleHAiOiIxNTI3NDQ4ODIyIiwicmVnaW9uIjoid2VzdHVzIiwic3Vic2NyaXB0aW9uLWlkIjoiMzM1YmNhOGU4MGMzNGVhOThlZGUwYTBmNDNkNmQ4ZjciLCJwcm9kdWN0LWlkIjoiU3BlZWNoU2VydmljZXMuRnJlZSIsImNvZ25pdGl2ZS1zZXJ2aWNlcy1lbmRwb2ludCI6Imh0dHBzOi8vYXBpLmNvZ25pdGl2ZS5taWNyb3NvZnQuY29tL2ludGVybmFsL3YxLjAvIiwiYXp1cmUtcmVzb3VyY2UtaWQiOiIiLCJzY29wZSI6InNwZWVjaHNlcnZpY2VzIiwiYXVkIjoidXJuOm1zLnNwZWVjaHNlcnZpY2VzLndlc3R1cyJ9.TaNVftHAYkF1Ouw2EB_ALJRAX5IJfC65E9ejx_KHL9c

Connect to server to synthesize the wave
200 OK
The synthesized wave length: 212934

Process finished with exit code 0

Neural voices

Attempting to use php to test the Neural voices now available:
Region | Endpoint
East US | https://eastus.tts.speech.microsoft.com/cognitiveservices/v1

Created a resource in East US and generated a key and adjusted the following:

The request return:
Warning: file_get_contents(https://eastus.tts.speech.microsoft.com/cognitiveservices/v1): failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized

Have you been successful in rendering TTS using the Neural voice?

cant play sound

both android simple and http-simple cant play sound,doesn't work .how to fix

C# example does not work

I put in my key and got the following

Starting Authtentication
Token: eyJ0eXAiOi very long token //snip//

Starting TTSSample request code execution.
Response status code: [Forbidden]
Unable to complete the TTS request: [CognitiveServicesTTS.GenericEventArgs`1[System.Exception]]

401 Auth Error

Following the directions on 2017-Jun-26, code throws in TTSClient.cs line 119 with web response 401 unauthorized. I do have the Cognitive Services key generated from Azure Portal (generated 1 hour before trying the code) embedded in line 81 of TTSProgram.cs.

Confidence

Hi what is the general rule of thumb for the confidence in Microsoft Cognitive Services? Do you have any graph or anything available which states if it is less than 50% don't trust the results and if it is above 50% do trust the results. Like also if it is 90%+ it is extremely accurate results etc.

[NodeJS Code Sample] Content-Length is not properly set

Here post_speak_data.length is actually not the right way to get the Content-Length, because NodeJS has native support for UTF-8. So "你好".length == 2 while the correct way of calculating Content-Length should be by bytes rather than characters.

Here is the correct way to calculate byte size: Buffer.byteLength(post_speak_data, 'utf-8')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.