Jelajahi Sumber

语音调试

林琦海 5 tahun lalu
induk
melakukan
3ffaf126a4
2 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 1 1
      biz-ghs/ws/services/WsService.php
  2. 2 1
      common/components/baiduAip.php

+ 1 - 1
biz-ghs/ws/services/WsService.php

@@ -12,7 +12,7 @@ class WsService
     {
         $msg = '到账'.$money;
 
-        $audio = baiduAip::transfer($msg);
+        $audio = baiduAip::transfer($msg,5,3);
         if(!is_array($audio)){
             try{
                 $audio = base64_encode($audio);

+ 2 - 1
common/components/baiduAip.php

@@ -12,12 +12,13 @@ class baiduAip
 {
 
     //transfer
-    public static function transfer($text,$spd=5)
+    public static function transfer($text,$spd=5,$per=0)
     {
         try{
             $client = self::getClient();
             $res = $client->synthesis($text,'zh',1,[
                 'spd'=>$spd,
+                'per'=>$per,
             ]);
             return $res;
         }catch (\Exception $exception){