fa盖/voicetext

voicetext web api beta for php客户端

1.0.0 2020-03-01 13:35 UTC

This package is auto-updated.

Last update: 2024-08-29 04:19:49 UTC


README

Latest Stable Version Latest Unstable Version License

VoiceText Web API 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();

其他示例

$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();

异常

RequestErrorException

400错误

NotAuthorizedException

401错误

HttpNotFoundException

404错误

HttpMethodErrorException

405错误

ServerErrorException

500错误

ServiceErrorException

503错误