naroat / voice-api
There is no license information available for the latest version (v1.0.0) of this package.
v1.0.0
2025-04-11 03:00 UTC
Requires
- guzzlehttp/guzzle: ^7.9
Requires (Dev)
- phpunit/phpunit: ^11.5
README
ai语音api
功能
已支持:
- 阿里云
使用
$voice = new Voice(); $aliyunVoice = $voice->driver('aliyun', [ 'appkey' => 'you appkey', 'token' => 'you token', ]); $response = $aliyunVoice->setText('今天是周一,天气挺好的。') ->setVoice('xiaoyun') ->setFormat('mp3') ->tts(); //save file if ($response->getStatusCode() == 200 && in_array('audio/mpeg', $response->getHeader('Content-Type'))) { file_put_contents('./tmp.mp3', $response->getBody()); }