lh před 5 dny
rodič
revize
8f573029d9
1 změnil soubory, kde provedl 20 přidání a 10 odebrání
  1. 20 10
      app/Services/DeepSeek/DeepSeekService.php

+ 20 - 10
app/Services/DeepSeek/DeepSeekService.php

@@ -232,8 +232,17 @@ class DeepSeekService
                 }
             }
 
-            // 组装章节分句音频数据
             $tmp = $word;
+            // 组装章节分句音频数据
+            // $tmp['sequence'] = getProp($word, 'sequence');
+            // $tmp['text'] = getProp($word, 'text');
+            // $tmp['emotion'] = getProp($word, 'emotion');
+            // $tmp['emotion_type'] = getProp($word, 'emotion_type');
+            // $tmp['voice_name'] = getProp($word, 'voice_name');
+            // $tmp['voice_type'] = getProp($word, 'voice_type');
+            // $tmp['speed_ratio'] = getProp($word, 'speed_ratio');
+            // $tmp['loudness_ratio'] = getProp($word, 'loudness_ratio');
+            // $tmp['emotion_scale'] = getProp($word, 'emotion_scale');
             $tmp['bid'] = $bid;
             $tmp['version_id'] = $version_id;
             $tmp['cid'] = $cid;
@@ -288,13 +297,13 @@ class DeepSeekService
                 Utils::throwError('20003:创建任务失败');
             }
 
-            // 删除章节分句音频数据并重新插入
-            DB::table('mp_chapter_paragraph_audios')->where('bid', $bid)->where('version_id', $version_id)->where('cid', $cid)->delete();
-            $boolen3 = DB::table('mp_chapter_paragraph_audios')->insert($mp_chapter_paragraph_audios);
-            if (!$boolen3) {
-                DB::rollBack();
-                Utils::throwError('20003:更新章节分句音频失败');
-            }
+            // // 删除章节分句音频数据并重新插入
+            // DB::table('mp_chapter_paragraph_audios')->where('bid', $bid)->where('version_id', $version_id)->where('cid', $cid)->delete();
+            // $boolen3 = DB::table('mp_chapter_paragraph_audios')->insert($mp_chapter_paragraph_audios);
+            // if (!$boolen3) {
+            //     DB::rollBack();
+            //     Utils::throwError('20003:更新章节分句音频失败');
+            // }
 
         } catch (\Exception $e) {
             DB::rollBack();
@@ -305,8 +314,9 @@ class DeepSeekService
         // 通知火山生成音频
         $client = new Client(['timeout' => 300, 'verify' => false]);
         // 根据ID通过API通知合成音频
-        // $result = $client->get("http://47.240.171.155:5000/api/chapterTask?taskId={$id}");
-        $result = $client->get("http://122.9.129.83:5000/api/chapterTask?taskId={$id}");
+        // $result = $client->get("http://47.240.171.155:5000/api/chapterTask?taskId={$audio_id}");
+        $audio_id = getProp($chapter_audio, 'id');
+        $result = $client->get("http://122.9.129.83:5000/api/chapterTask?taskId={$audio_id}");
         $response = $result->getBody()->getContents();
         $response_arr = json_decode($response, true);
         if (!isset($response_arr['code']) || (int)$response_arr['code'] !== 0) {