To call Azure Marketplace Translation (and Speech) service

Dependencies:   EthernetInterface-FRDM HTTPClient-SSL R_BSP SDFileSystem TLV320_RBSP USBHost mbed-rtos mbed-src

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SpeechSynthesizer.h Source File

SpeechSynthesizer.h

00001 ////////////////////////////////////////////////////////////////////////////
00002 //  Licensed under the Apache License, Version 2.0 (the "License");
00003 //  you may not use this file except in compliance with the License.
00004 //  You may obtain a copy of the License at
00005 //
00006 //    http://www.apache.org/licenses/LICENSE-2.0
00007 //
00008 //  Unless required by applicable law or agreed to in writing, software
00009 //  distributed under the License is distributed on an "AS IS" BASIS,
00010 //  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00011 //  See the License for the specific language governing permissions and
00012 //  limitations under the License.
00013 //
00014 //  Copyright (c) Microsoft Corporation.  All rights reserved.
00015 //  Portions Copyright (c) Kentaro Sekimoto All rights reserved.
00016 //
00017 //  Based on Text-To-Speech for .NET Micro Framework with Microsoft 
00018 //  Translator Service
00019 //  https://code.msdn.microsoft.com/Text-To-Speech-for-NET-9cea4462
00020 //
00021 ////////////////////////////////////////////////////////////////////////////
00022 
00023 #include "mbed.h"
00024 
00025 class SpeechSynthesizer
00026 {
00027 public:
00028     SpeechSynthesizer(const char *clientID, const char *clientSecret);
00029     void GetSpeakStream(char *filename, char *text, char *language);
00030     void UpdateToken();
00031     char *Translate(char *text, char *to);
00032     ~SpeechSynthesizer();
00033 private:
00034     char *id;
00035     char *secret;
00036     char *language;
00037     char *audioFormat;
00038     char *audioQuality;
00039     char token[512];
00040 };