|
|
@@ -2708,6 +2708,13 @@ function handleEpisodeContent($originalContent) {
|
|
|
'scene' => '', // 新增:场景
|
|
|
'characters' => '', // 新增:出镜角色
|
|
|
'tail_frame' => '', // 新增:尾帧描述
|
|
|
+ // 新增字段
|
|
|
+ 'emotion' => '中性', // 新增: 情感
|
|
|
+ 'gender' => '0', // 新增: 性别(0未知,1男,2女)
|
|
|
+ 'speed_ratio' => 0, // 新增: 语速
|
|
|
+ 'loudness_ratio' => 0, // 新增: 音量
|
|
|
+ 'emotion_scale' => 4, // 新增: 语调
|
|
|
+ 'pitch' => 0, // 新增: 音调
|
|
|
];
|
|
|
|
|
|
// 提取各个字段 - 兼容中文冒号和英文冒号,支持多种表达方式
|
|
|
@@ -2741,6 +2748,37 @@ function handleEpisodeContent($originalContent) {
|
|
|
if (preg_match('/(?:尾帧描述|尾帧|结束帧|最后一帧|结尾画面|结束画面)[::]\s*([^\n]+)/u', $segmentContent, $tailFrameMatch)) {
|
|
|
$segmentData['tail_frame'] = trim($tailFrameMatch[1]);
|
|
|
}
|
|
|
+ // 新增:情感字段
|
|
|
+ if (preg_match('/(?:情感|情绪|感情)[::]\s*([^\n]+)/u', $segmentContent, $emotionMatch)) {
|
|
|
+ $segmentData['emotion'] = trim($emotionMatch[1]);
|
|
|
+ }
|
|
|
+ // 新增:性别字段
|
|
|
+ if (preg_match('/(?:性别)[::]\s*([^\n]+)/u', $segmentContent, $genderMatch)) {
|
|
|
+ $genderStr = trim($genderMatch[1]);
|
|
|
+ if (strpos($genderStr, '男') !== false || $genderStr === '1') {
|
|
|
+ $segmentData['gender'] = '1';
|
|
|
+ } elseif (strpos($genderStr, '女') !== false || $genderStr === '2') {
|
|
|
+ $segmentData['gender'] = '2';
|
|
|
+ } else {
|
|
|
+ $segmentData['gender'] = '0';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 新增:语速字段
|
|
|
+ if (preg_match('/(?:语速|说话速度)[::]\s*([-+]?[0-9]*\.?[0-9]+)/u', $segmentContent, $speedMatch)) {
|
|
|
+ $segmentData['speed_ratio'] = (float)trim($speedMatch[1]);
|
|
|
+ }
|
|
|
+ // 新增:音量字段
|
|
|
+ if (preg_match('/(?:音量|声音大小)[::]\s*([-+]?[0-9]*\.?[0-9]+)/u', $segmentContent, $loudnessMatch)) {
|
|
|
+ $segmentData['loudness_ratio'] = (float)trim($loudnessMatch[1]);
|
|
|
+ }
|
|
|
+ // 新增:情感强度字段
|
|
|
+ if (preg_match('/(?:情感强度|情绪强度)[::]\s*([0-9]+)/u', $segmentContent, $scaleMatch)) {
|
|
|
+ $segmentData['emotion_scale'] = (int)trim($scaleMatch[1]);
|
|
|
+ }
|
|
|
+ // 新增:音调字段
|
|
|
+ if (preg_match('/(?:音调|音高)[::]\s*([-+]?[0-9]+)/u', $segmentContent, $pitchMatch)) {
|
|
|
+ $segmentData['pitch'] = (int)trim($pitchMatch[1]);
|
|
|
+ }
|
|
|
|
|
|
$segments[] = $segmentData;
|
|
|
}
|