更新语音

This commit is contained in:
yaooo 2023-10-10 14:17:16 +08:00
parent 756be58d0f
commit 0c1373229e

View File

@ -247,7 +247,7 @@ class XunFeiController extends BaseApiController
} }
$date = date('YmdHis', time()); $date = date('YmdHis', time());
$file_name = $date . mt_rand(1000, 9999) . '.mp3'; $file_name = $date . mt_rand(1000, 9999) . '.mp3';
$audioFile = app()->getRootPath() . '/runtime/storage/audio/' . date('Ymd') . '/' . $file_name; $audioFile = app()->getRootPath() . '/public/uploads/audio/' . date('Ymd') . '/' . $file_name;
$business = [ $business = [
'aue' => 'lame', //mp3格式 'aue' => 'lame', //mp3格式
'vcn' => 'xiaoyan', //发音人 'vcn' => 'xiaoyan', //发音人
@ -263,7 +263,7 @@ class XunFeiController extends BaseApiController
} catch (\Exception $e) { } catch (\Exception $e) {
return $this->fail($e->getMessage().''); return $this->fail($e->getMessage().'');
} }
return $this->data(['audio_file' => $audioFile]); return $this->data(['audio_file' => '/uploads/audio/' . date('Ymd') . '/' . $file_name]);
} }
} }