12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- namespace App\Services\Vendor\Xunfei;
- /**
- * 讯飞基类
- */
- class Voice2Text
- {
- public const BASE_URI = 'https://raasr.xfyun.cn/api/';
- /**
- * 发送请求对象
- */
- private $httpClient;
- /**
- * 构造方法
- */
- public function __construct()
- {
- $this->httpClient = new HttpBase(self::BASE_URI);
- }
- /**
- * 预处理方法
- */
- public function prepare($extData)
- {
- return $this->httpClient->postForm('prepare', $extData);
- }
- /**
- * 上传方法
- */
- public function upload($extData)
- {
- return $this->httpClient->postMulti('upload', $extData);
- }
- /**
- * 合并方法
- */
- public function merge($taskId)
- {
- $extData = [
- 'task_id' => $taskId,
- ];
- return $this->httpClient->postForm('merge', $extData);
- }
- /**
- * 预处理方法
- */
- public function getProgress($taskId)
- {
- $extData = [
- 'task_id' => $taskId,
- ];
- return $this->httpClient->postForm('getProgress', $extData);
- }
- /**
- * 预处理方法
- */
- public function getResult($taskId)
- {
- $extData = [
- 'task_id' => $taskId,
- ];
- return $this->httpClient->postForm('getResult', $extData);
- }
- }
|