fagai/voicetext

voicetext web api beta for php client

1.0.0 2020-03-01 13:35 UTC

This package is auto-updated.

Last update: 2024-09-29 04:31:00 UTC


README

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