Commit f7b3f8cb authored by nick zheng's avatar nick zheng

chore: 数字人对话剔除语调、粤语音色默认值

parent 8de3cea8
...@@ -31,10 +31,13 @@ const timebreId = computed(() => digitalHumanDialogueStore.humanInfo.timebreId) ...@@ -31,10 +31,13 @@ const timebreId = computed(() => digitalHumanDialogueStore.humanInfo.timebreId)
@click="emit('click', dialogueTimbreItem!.timebreId)" @click="emit('click', dialogueTimbreItem!.timebreId)"
> >
<div <div
class="h-16 w-16 rounded-lg bg-[url(https://digital-human-js-cdn.cdn.bcebos.com/web_base/20240926112018/digital-human-web-new-base/img/boy.png)] bg-[length:100%_100%]" class="h-16 w-16 rounded-lg bg-[length:100%_100%]"
></div> :style="{
backgroundImage: `url(${dialogueTimbreItem?.iconUrl || 'https://digital-human-js-cdn.cdn.bcebos.com/web_base/20240926112018/digital-human-web-new-base/img/boy.png'})`,
}"
/>
<div class="flex-1 overflow-hidden"> <div class="flex-1 overflow-hidden">
<div class="mb-2 flex items-center gap-2"> <div class="mb-3 flex items-center gap-2">
<div class="max-w-32 truncate">{{ dialogueTimbreItem?.name }}</div> <div class="max-w-32 truncate">{{ dialogueTimbreItem?.name }}</div>
<CustomIcon <CustomIcon
class="cursor-pointer text-lg" class="cursor-pointer text-lg"
...@@ -44,7 +47,9 @@ const timebreId = computed(() => digitalHumanDialogueStore.humanInfo.timebreId) ...@@ -44,7 +47,9 @@ const timebreId = computed(() => digitalHumanDialogueStore.humanInfo.timebreId)
</div> </div>
<NScrollbar x-scrollable> <NScrollbar x-scrollable>
<div class="flex gap-2"> <div class="flex gap-2">
<NTag v-for="(style, index) in dialogueTimbreItem?.style" :key="index" type="warning" round>{{ style }}</NTag> <NTag v-for="(style, index) in dialogueTimbreItem?.style" :key="index" type="warning" round>
{{ style }}
</NTag>
</div> </div>
</NScrollbar> </NScrollbar>
</div> </div>
......
...@@ -13,6 +13,14 @@ const sexList = [ ...@@ -13,6 +13,14 @@ const sexList = [
{ key: 1, label: '男性' }, { key: 1, label: '男性' },
] ]
const speedMarks: { [speed: number]: string } = {
3: '0.5x',
4: '0.8x',
5: '1x',
6: '1.3x',
7: '1.5x',
}
const currentSelectedAudioType = ref('mandarin') const currentSelectedAudioType = ref('mandarin')
const audioTypeList = [ const audioTypeList = [
...@@ -38,15 +46,6 @@ const speed = computed({ ...@@ -38,15 +46,6 @@ const speed = computed({
}, },
}) })
const intonation = computed({
get() {
return digitalHumanDialogueStore.humanInfo.intonation
},
set(value) {
digitalHumanDialogueStore.setIntonation(value)
},
})
const isMandarinAudioType = computed(() => { const isMandarinAudioType = computed(() => {
return currentSelectedAudioType.value === 'mandarin' return currentSelectedAudioType.value === 'mandarin'
}) })
...@@ -75,7 +74,17 @@ async function getDigitalTimbreList() { ...@@ -75,7 +74,17 @@ async function getDigitalTimbreList() {
} }
function handleUpdateAudioType(audioType: string) { function handleUpdateAudioType(audioType: string) {
digitalHumanDialogueStore.humanInfo.timebreId = audioType === 'mandarin' ? '5132' : '' digitalHumanDialogueStore.humanInfo.timebreId = audioType === 'mandarin' ? '5132' : '101019'
digitalAudioRef.value?.pause()
}
function handleToAudioList() {
showAll.value = true
digitalAudioRef.value?.pause()
}
function handleBack() {
showAll.value = false
digitalAudioRef.value?.pause() digitalAudioRef.value?.pause()
} }
...@@ -116,7 +125,7 @@ function handlePlayDigitalAudio(audioUrl: string) { ...@@ -116,7 +125,7 @@ function handlePlayDigitalAudio(audioUrl: string) {
<DigitalAudioCard <DigitalAudioCard
:dialogue-timbre-item="digitalTimbreValue" :dialogue-timbre-item="digitalTimbreValue"
:show-toggle="true" :show-toggle="true"
@toggle="showAll = true" @toggle="handleToAudioList"
@play="handlePlayDigitalAudio" @play="handlePlayDigitalAudio"
/> />
</div> </div>
...@@ -124,19 +133,14 @@ function handlePlayDigitalAudio(audioUrl: string) { ...@@ -124,19 +133,14 @@ function handlePlayDigitalAudio(audioUrl: string) {
<div class="mt-4 text-lg">聲音</div> <div class="mt-4 text-lg">聲音</div>
<div class="mt-4 flex items-center gap-2"> <div class="mt-4 flex items-center gap-2">
<div class="w-12">語速:</div> <div class="w-12">語速:</div>
<n-slider v-model:value="speed" class="flex-1" :max="15" :min="0" :step="1" /> <n-slider v-model:value="speed" class="flex-1" :max="7" :min="3" :step="1" />
<div class="w-10 text-center">{{ speed }}</div> <div class="w-10 text-center">{{ speedMarks[speed] }}</div>
</div>
<div class="mt-4 flex items-center gap-2">
<div class="w-12">語調:</div>
<n-slider v-model:value="intonation" class="flex-1" :max="15" :min="0" :step="1" />
<div class="w-10 text-center">{{ intonation }}</div>
</div> </div>
</NScrollbar> </NScrollbar>
<div v-else> <div v-else>
<div class="flex items-center gap-4 px-4 pb-3"> <div class="flex items-center gap-4 px-4 pb-3">
<n-button text @click="showAll = false"> <n-button text @click="handleBack">
<template #icon> <template #icon>
<CustomIcon class="text-lg" icon="mingcute:left-line" /> <CustomIcon class="text-lg" icon="mingcute:left-line" />
</template> </template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment