2017 © Pedro Peláez
 

library xfyun

科大讯飞 REST API PHP SDK

image

delz/xfyun

科大讯飞 REST API PHP SDK

  • Thursday, April 19, 2018
  • by sheawey
  • Repository
  • 1 Watchers
  • 1 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 122 % Grown

The README.md

科大讯飞 REST API PHP SDK

如何获取

composer require delz/xfyun

参考文档地址

http://doc.xfyun.cn/rest_api/, (*1)

调用语音合成接口

  1. 实例化客户端对象, (*2)

    $client = new Client("{APPID}","{APIKEY}");, (*3)

  2. 生成TTS对象,并发送请求, (*4)

    try {   
        $content = $client->createTTS()->setText('您好')->send();    
        $file = fopen(__DIR__ . '/test.wav',"w");    
        fwrite($file, $content);   
        fclose($file);   
    } catch(ApiException $e) {   
        echo $e->getMessage();  
    }

语音听写接口

  1. 实例化客户端对象, (*5)

    $client = new Client("{APPID}","{APIKEY}");, (*6)

  2. 生成IAT对象,并发送请求, (*7)

    try {
        $content = $client->createIAT()->setAudio(file_get_contents(__DIR__.'/test.wav'))->send();
        echo $content;
    } catch(ApiException $e) {
        echo $e->getMessage();
    }

The Versions

19/04 2018

dev-master

9999999-dev

科大讯飞 REST API PHP SDK

  Sources   Download

MIT

The Requires

 

by 徐威

19/04 2018

0.2

0.2.0.0

科大讯飞 REST API PHP SDK

  Sources   Download

MIT

The Requires

 

by 徐威

19/04 2018

0.1

0.1.0.0

科大讯飞 REST API PHP SDK

  Sources   Download

MIT

The Requires

 

by 徐威