lh 4 gün önce
ebeveyn
işleme
3f252e9d7b

+ 11 - 13
app/Console/Test/TestCommand.php

@@ -48,29 +48,27 @@ class TestCommand extends Command
      */
     public function handle()
     {
-        $filename = '%E6%B5%8B%E8%AF%95%E9%9F%B3%E6%95%88.mp4';
-        $filename = 'abc测试音效.mp4';
-        dd(urldecode($filename));
-        // $wavPath = public_path('wav');
+        // $wavPath = public_path('audio');
         // if (!file_exists($wavPath)) {
         //     return [];
         // }
         
         // $files = scandir($wavPath);
         
-        // $insert_data = [];
+        // $error_voice = [];
         // foreach ($files as $file) {
         //     if ($file !== '.' && $file !== '..') {
-        //         $insert_data[] = [
-        //             'audio_effect_name' => pathinfo($file, PATHINFO_FILENAME),
-        //             'audio_effect_url'  => 'https://cdn-zwai.ycsd.cn/mp_audio/audio_effects/'.$file,
-        //             'is_enabled'        => 1,
-        //             'created_at'        => date('Y-m-d H:i:s'),
-        //             'updated_at'        => date('Y-m-d H:i:s'),
-        //         ];
+        //         $voice_type = pathinfo($file, PATHINFO_FILENAME);
+        //         $boolen = DB::table('mp_timbres')->where('timbre_type', $voice_type)->update([
+        //             'audio_url'     => 'https://cdn-zwai.ycsd.cn/mp_audio/voice_demo/' . $file,
+        //             'is_enabled'    => 1,
+        //             'updated_at'    => date('Y-m-d H:i:s'),
+        //         ]);
+        //         if (!$boolen) $error_voice[] = $file;
         //     }
         // }
-        // DB::table('mp_audio_effects')->insert($insert_data);
+        // \Log::info('错误文件:' . json_encode($error_voice, 256));
+        // exit();
 
         // exit();
         $bid = 321;

+ 6 - 0
app/Services/Book/BookService.php

@@ -188,6 +188,12 @@ class BookService
                     'role'                  => $role,
                     'voice_type'            => $voice_type,
                     'voice_name'            => getProp($timbre, 'timbre_name'),
+                    'emotion'               => getProp($timbre, 'emotion'),
+                    'emotion_type'          => getProp($timbre, 'emotion_type'),
+                    'speed_ratio'           => getProp($timbre, 'speed_ratio'),
+                    'loudness_ratio'        => getProp($timbre, 'loudness_ratio'),
+                    'emotion_scale'         => getProp($timbre, 'emotion_scale'),
+                    'pitch'                 => getProp($timbre, 'pitch'),
                     'language'              => getProp($timbre_info,'language'),
                     'dialect'               => getProp($timbre_info,'dialect'),
                     'emotion'               => getProp($timbre_info,'emotion'),

+ 16 - 3
app/Services/DeepSeek/DeepSeekService.php

@@ -273,6 +273,14 @@ class DeepSeekService
             $existed_role_info[$role] = [
                 'timbre_type'   => $word['voice_type'],
                 'timbre_name'   => $word['voice_name'],
+                'emotion'       => $word['emotion'],
+                'emotion_type'  => $word['emotion_type'],
+                'speed_ratio'   => $word['speed_ratio'],
+                'loudness_ratio'=> $word['loudness_ratio'],
+                'emotion_scale' => $word['emotion_scale'],
+                'pitch'         => $word['pitch']
+            ];
+            $word['paragraph_audio_url'
             ];
             $word['paragraph_audio_url'] = '';
 
@@ -472,8 +480,9 @@ class DeepSeekService
     }
 
     public function emotionGroups($data) {
+        $id = getProp($data, 'group_id');
         $group_name = getProp($data, 'group_name');
-        $label = getProp($data, 'label');
+        $voice_type = getProp($data, 'voice_type');
 
         $query = DB::table('mp_emotion_groups')->where('is_enabled', 1)->select('id as group_id', 'group_name',
         'emotion', 'emotion_type', 'voice_name', 'voice_type', 'speed_ratio', 'loudness_ratio', 'emotion_scale',
@@ -483,8 +492,12 @@ class DeepSeekService
             $query->where('group_name', 'like', "%{$group_name}%");
         }
 
-        if ($label) {
-            $query->where('label', 'like', $label);
+        if ($id) {
+            $query->where('id', $id);
+        }
+
+        if ($voice_type) {
+            $query->where('voice_type', $voice_type);
         }
 
         return $query->orderBy('id')->get()->map(function ($value) {

+ 8 - 3
app/Services/Timbre/TimbreService.php

@@ -256,8 +256,9 @@ class TimbreService
     }
 
     public function emotionGroupList($data) {
+        $id = getProp($data, 'group_id');
         $group_name = getProp($data, 'group_name');
-        $label = getProp($data, 'label');
+        $voice_type = getProp($data, 'voice_type');
 
         $query = DB::table('mp_emotion_groups')->where('is_enabled', 1)->select('*');
 
@@ -265,8 +266,12 @@ class TimbreService
             $query->where('group_name', 'like', "%{$group_name}%");
         }
 
-        if ($label) {
-            $query->where('label', 'like', $label);
+        if ($id) {
+            $query->where('id', $id);
+        }
+
+        if ($voice_type) {
+            $query->where('voice_type', $voice_type);
         }
 
         return $query->orderBy('id')->paginate();