|
@@ -74,6 +74,18 @@
|
|
|
<text class="emotion-label">推荐音色</text>
|
|
<text class="emotion-label">推荐音色</text>
|
|
|
<text class="emotion-value voice-value">{{ detectedVoiceName }}</text>
|
|
<text class="emotion-value voice-value">{{ detectedVoiceName }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view v-if="detectedScene" class="emotion-row">
|
|
|
|
|
+ <text class="emotion-label">场景</text>
|
|
|
|
|
+ <text class="emotion-value scene-value">{{ detectedScene }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-if="detectedIdentity" class="emotion-row">
|
|
|
|
|
+ <text class="emotion-label">身份</text>
|
|
|
|
|
+ <text class="emotion-value identity-value">{{ detectedIdentity }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-if="detectedRole" class="emotion-row">
|
|
|
|
|
+ <text class="emotion-label">角色</text>
|
|
|
|
|
+ <text class="emotion-value role-value">{{ detectedRole }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
|
|
|
<!-- 情感覆盖选择器 -->
|
|
<!-- 情感覆盖选择器 -->
|
|
|
<view class="emotion-override">
|
|
<view class="emotion-override">
|
|
@@ -100,6 +112,10 @@
|
|
|
<text class="emotion-label">情感</text>
|
|
<text class="emotion-label">情感</text>
|
|
|
<text class="emotion-value emotion-fallback">{{ detectedEmotionLabel || '中性' }}</text>
|
|
<text class="emotion-value emotion-fallback">{{ detectedEmotionLabel || '中性' }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view v-if="detectedScene" class="emotion-row">
|
|
|
|
|
+ <text class="emotion-label">场景</text>
|
|
|
|
|
+ <text class="emotion-value scene-value">{{ detectedScene }}</text>
|
|
|
|
|
+ </view>
|
|
|
<text class="emotion-hint">未匹配到特定内容类型,使用通用音色</text>
|
|
<text class="emotion-hint">未匹配到特定内容类型,使用通用音色</text>
|
|
|
|
|
|
|
|
<!-- 情感覆盖选择器 -->
|
|
<!-- 情感覆盖选择器 -->
|
|
@@ -333,6 +349,9 @@ const detecting = ref(false);
|
|
|
const detectedEmotion = ref(false);
|
|
const detectedEmotion = ref(false);
|
|
|
const detectedEmotionLabel = ref('');
|
|
const detectedEmotionLabel = ref('');
|
|
|
const detectedVoiceName = ref('');
|
|
const detectedVoiceName = ref('');
|
|
|
|
|
+const detectedScene = ref(''); // 检测到的场景
|
|
|
|
|
+const detectedRole = ref(''); // 检测到的角色
|
|
|
|
|
+const detectedIdentity = ref(''); // 检测到的身份
|
|
|
const emotionDetectAttempted = ref(false);
|
|
const emotionDetectAttempted = ref(false);
|
|
|
const selectedEmotion = ref(''); // 用户手动选择的情感,空=不覆盖
|
|
const selectedEmotion = ref(''); // 用户手动选择的情感,空=不覆盖
|
|
|
|
|
|
|
@@ -373,10 +392,16 @@ function debouncedDetect() {
|
|
|
emotion?: string;
|
|
emotion?: string;
|
|
|
emotionLabel?: string;
|
|
emotionLabel?: string;
|
|
|
hint?: string;
|
|
hint?: string;
|
|
|
|
|
+ scene?: string;
|
|
|
|
|
+ role?: string | null;
|
|
|
|
|
+ identity?: string | null;
|
|
|
}>('/tts/detect-emotion', { text: text.value });
|
|
}>('/tts/detect-emotion', { text: text.value });
|
|
|
detectedEmotion.value = res.detected || false;
|
|
detectedEmotion.value = res.detected || false;
|
|
|
detectedEmotionLabel.value = res.emotionLabel || '';
|
|
detectedEmotionLabel.value = res.emotionLabel || '';
|
|
|
detectedVoiceName.value = res.voiceName || '';
|
|
detectedVoiceName.value = res.voiceName || '';
|
|
|
|
|
+ detectedScene.value = res.scene || '';
|
|
|
|
|
+ detectedRole.value = res.role || '';
|
|
|
|
|
+ detectedIdentity.value = res.identity || '';
|
|
|
if (res.emotion && !selectedEmotion.value) {
|
|
if (res.emotion && !selectedEmotion.value) {
|
|
|
// 首次检测到情感时,自动选中(但不覆盖用户手动选择)
|
|
// 首次检测到情感时,自动选中(但不覆盖用户手动选择)
|
|
|
}
|
|
}
|
|
@@ -626,6 +651,9 @@ function goToMember() { showQuotaModal.value = false; uni.navigateTo({ url: '/pa
|
|
|
.emotion-value { font-size: 26rpx; font-weight: 600; color: #1f2937; }
|
|
.emotion-value { font-size: 26rpx; font-weight: 600; color: #1f2937; }
|
|
|
.emotion-value.voice-value { color: #4f46e5; }
|
|
.emotion-value.voice-value { color: #4f46e5; }
|
|
|
.emotion-value.emotion-fallback { color: #9ca3af; }
|
|
.emotion-value.emotion-fallback { color: #9ca3af; }
|
|
|
|
|
+.emotion-value.scene-value { color: #0891b2; }
|
|
|
|
|
+.emotion-value.identity-value { color: #7c3aed; }
|
|
|
|
|
+.emotion-value.role-value { color: #059669; }
|
|
|
.emotion-hint { font-size: 20rpx; color: #9ca3af; margin-top: 4rpx; }
|
|
.emotion-hint { font-size: 20rpx; color: #9ca3af; margin-top: 4rpx; }
|
|
|
|
|
|
|
|
/* 情感覆盖选择器 */
|
|
/* 情感覆盖选择器 */
|