Skip to content

tetsuwo/php-voicetext-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VoiceTextAPI

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

The unofficial PHP client for the VoiceText Web API.

Demonstration

Installation

Install Composer.

Add below in require property on composer.json.

{
    "require": {
        "tetsuwo/voicetext-api": "dev-master"
    }
}

Execute below command.

$ php composer.phar install

Usage

At first, set up client.

$client = new Tetsuwo\VoiceText\API\Client('{API_KEY}', '{API_PASSWORD}');

Method of Speech synthesis (Text-to-speech)

Execute PHP code below to get the Speech synthesis data of specified text.
And there are binary data of WAV format in $response.

$response = $client->getTts(array(
    'text'    => 'こんばんは、モヤモヤさ◯ぁ~ずです。',
    'speaker' => show'
));

Returns the data string for WAV format.

echo 'data:audio/wav;base64,', base64_encode($response);

Execute the JavaScript code below to play.

var audio = new Audio('data:audio/wav;base64,~~~~~~~~~~~');
audio.play();

See official website more details.

LICENSE

This software is released under the MIT License, see LICENSE.

SEE ALSO

About

The unofficial PHP client for the VoiceText Web API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages