定制 uzulla/voicetext-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

uzulla/voicetext-api

Composer 安装命令:

composer require uzulla/voicetext-api

包简介

VoiceText Web API(https://cloud.voicetext.jp/webapi) wrapper library.

关键字:

README 文档

README

VoiceText Web APIをPHPから利用するためのライブラリです。

This library for VoiceText Web API.

VoiceText Web APIは、入力したテキストを音声ファイル(Wav形式)でダウンロードできるものです。

VoiceText is Text-To-Speech software, that API generate wave audio file.

VoiceText Web API は HOYAサービス株式会社様が提供するWEB APIです。詳細はこちら VoiceText Web API

VoiceText Web API provided by HOYA Service Corporation. Detail here. VoiceText Web API

REQUIRE

  • PHP>=5.4
  • Composer

SETUP

composerでuzulla/voicetext-apiをrequireしてください。

SYNOPSIS(利用例)

<?php
require_once('vendor/autoload.php');

use \Uzulla\WebApi\VoiceText\Request as VTR;
use \Uzulla\WebApi\VoiceText\Query as VTQ;

// setup
\Uzulla\WebApi\VoiceText\Query::$defaultApiKey = 'YOUR API KEY';

// build query
$query = new VTQ;
$query->text = 'hello';

// request
$res = VTR::getResponse($query);

if($res->isSuccess()){
  $downloaded_wav_file_name = $res->tempFileName;
}else{
  echo "request fail.";
  var_dump($res);
}

also ...

<?php
// ...

// param details, see official api doc https://cloud.voicetext.jp/webapi/docs/api
$query = new VTQ;
$query->text = 'こんにちは';
$query->speaker = 'haruka';
$query->emotion = 'happiness';
$query->emotion_level = 2;
$query->pitch = 100;
$query->speed = 100;
$query->volume = 100;

$error_list = $query->validate();

if(!empty($error_list)){
  // query is invalid (local validation). use correct data.
  var_dump($error_list); // array(1) { 'emotion' => string(35) "specify speaker not support emotion" }

}else{
  // request
  $res = VTR::getResponse($query);

  if($res->isSuccess()){
    $downloaded_wav_file_name = $res->tempFileName;
  }else{
    echo "request fail.";
    var_dump($res);
  }
}

SAMPLE

see sample/README.md

LICENSE

MIT

SEE ALSO

统计信息

  • 总下载量: 173
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-07-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固