fagai / voicetext
voicetext web api beta for php client
1.0.0
2020-03-01 13:35 UTC
Requires
- php: ^7.0
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-10-29 04:41:53 UTC
README
VoiceText Web API client for PHP
使う方法
composer require fagai/voicetext
<?php
use \Fagai\VoiceText\VoiceText;
$voice = new VoiceText('<your api key>');
$voice->speaker('hikari')
->emotion('happiness')
->emotion_level(2)
->pitch(150)
->speed(120)
->volume(150)
->text('今日も一日がんばるぞい!');
// get wav binary data
$binaryData = $voice->get();
Other Examples
$voice = new VoiceText('<your api key>');
$voice->setParams([
'speaker' => 'hikari',
'emotion' => 'happiness',
'emotion_level' => 2,
'pitch' => 150,
'speed' => 120,
'volume' => 150,
'text' => '今日も一日がんばるぞい!']);
$binaryData = $voice->get();
Exceptions
RequestErrorException
400 Error
NotAuthorizedException
401 Error
HttpNotFoundException
404 Error
HttpMethodErrorException
405 Error
ServerErrorException
500 Error
ServiceErrorException
503 Error