/php-voicetext

voicetext web api for php client

Primary LanguagePHPOtherNOASSERTION

PHP-VoiceText

Latest Stable Version Latest Unstable Version License

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