The unofficial PHP client for the VoiceText Web API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Tetsuwo/VoiceText/API
test
.gitignore
.travis.yml
LICENSE
README.md
composer.json
phpunit.xml

README.md

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