新增获取iatwss地址
This commit is contained in:
parent
5cfec74773
commit
47cbd46d7c
@ -30,7 +30,7 @@ use Guzzle\Http\Exception\RequestException;
|
||||
*/
|
||||
class XunFeiController extends BaseApiController
|
||||
{
|
||||
public array $notNeedLogin = ['chat', 'iat', 'tts', 'ocr'];
|
||||
public array $notNeedLogin = ['chat', 'iat', 'tts', 'ocr', 'iatWss'];
|
||||
|
||||
private $app_id='2eda6c2e';
|
||||
|
||||
@ -268,6 +268,17 @@ class XunFeiController extends BaseApiController
|
||||
return $this->data(['words' => $words]);
|
||||
}
|
||||
|
||||
//获取websocket
|
||||
public function iatWss()
|
||||
{
|
||||
header('X-Accel-Buffering: no');
|
||||
$iatHostUrl = "wss://iat-api.xfyun.cn/v2/iat";
|
||||
$iat = new IatClient($this->app_id, $this->api_key, $this->api_secret);
|
||||
$iat_wss = $iat->assembleAuthUrl($iatHostUrl);
|
||||
//后期添加鉴权
|
||||
return $this->data(['iat_wss' => $iat_wss]);
|
||||
}
|
||||
|
||||
//语音合成(流式版)
|
||||
public function tts()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user