Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
digitalPerson-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
digitalPerson
digitalPerson-fe
Commits
d22c5c4d
Commit
d22c5c4d
authored
Oct 08, 2024
by
Dazzle Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 视频数字人音频语言
parent
af13dd9c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
15 deletions
+11
-15
audio-setting.ts
src/store/modules/audio-setting.ts
+1
-6
creation.ts
src/store/modules/creation.ts
+4
-0
creation.ts
src/store/types/creation.ts
+0
-1
digital-audio.vue
src/views/creation/components/digital/digital-audio.vue
+3
-2
preview-content.vue
src/views/creation/components/preview-content.vue
+1
-1
index.vue
src/views/creation/layout/index.vue
+2
-5
No files found.
src/store/modules/audio-setting.ts
View file @
d22c5c4d
import
{
AudioConfig
,
LangType
,
VoiceType
}
from
'@/store/types/creation'
import
{
AudioConfig
,
VoiceType
}
from
'@/store/types/creation'
import
{
defineStore
}
from
'pinia'
function
defaultAudioSetting
():
AudioConfig
{
return
{
langType
:
LangType
.
CANTONESE
,
voiceType
:
VoiceType
.
CANTONESE_FEMALE
,
consumption
:
0
,
}
...
...
@@ -17,10 +16,6 @@ export const useAudioSettingStore = defineStore('audio-setting-store', {
state
:
():
AudioConfig
=>
getLocalState
(),
actions
:
{
setLanType
(
langType
:
LangType
)
{
this
.
langType
=
langType
},
setVoiceType
(
voiceType
:
VoiceType
)
{
this
.
voiceType
=
voiceType
},
...
...
src/store/modules/creation.ts
View file @
d22c5c4d
...
...
@@ -114,6 +114,10 @@ export const useDigitalCreationStore = defineStore('digital-creation-store', {
this
.
enabled
=
subtitleEnabled
},
setPronunciationLanguage
(
pronunciationLanguage
:
LangType
)
{
this
.
pronunciationLanguage
=
pronunciationLanguage
},
updateDigitalCreation
(
digitalCreation
:
Partial
<
DraftConfig
>
)
{
this
.
$state
=
{
...
this
.
$state
,
...
digitalCreation
}
},
...
...
src/store/types/creation.ts
View file @
d22c5c4d
...
...
@@ -28,7 +28,6 @@ export enum VoiceType {
}
export
interface
AudioConfig
{
langType
:
LangType
voiceType
:
VoiceType
consumption
:
number
}
...
...
src/views/creation/components/digital/digital-audio.vue
View file @
d22c5c4d
...
...
@@ -42,10 +42,10 @@ const showAll = ref(false)
const
langType
=
computed
({
get
()
{
return
audioSettingStore
.
langTyp
e
return
digitalCreationStore
.
pronunciationLanguag
e
},
set
(
value
)
{
audioSettingStore
.
setLanTyp
e
(
value
)
digitalCreationStore
.
setPronunciationLanguag
e
(
value
)
},
})
...
...
@@ -94,6 +94,7 @@ watch(
watch
(
()
=>
langType
.
value
,
(
newVal
)
=>
{
digitalCreationStore
.
setInputAudioUrl
(
''
)
if
(
newVal
===
LangType
.
CANTONESE
)
{
digitalCreationStore
.
setPerson
(
''
)
audioSettingStore
.
setVoiceType
(
VoiceType
.
CANTONESE_FEMALE
)
...
...
src/views/creation/components/preview-content.vue
View file @
d22c5c4d
...
...
@@ -123,7 +123,7 @@ function controlAudio() {
audioSetting
.
value
.
voiceType
!==
audioSettingStore
.
voiceType
||
audioSetting
.
value
.
speed
!==
ttsSpeedMarks
[
digitalCreationStore
.
speed
]
||
audioSetting
.
value
.
volume
!==
Number
(
digitalCreationStore
.
volume
)
||
(
audioSettingStore
.
langTyp
e
===
LangType
.
MANDARIN
&&
(
digitalCreationStore
.
pronunciationLanguag
e
===
LangType
.
MANDARIN
&&
audioSetting
.
value
.
pitch
!==
Number
(
digitalCreationStore
.
pitch
))
)
{
audioData
.
value
=
''
...
...
src/views/creation/layout/index.vue
View file @
d22c5c4d
...
...
@@ -76,10 +76,9 @@ async function getDigitalTemplate(id: string) {
logoUrl
:
digitalTemplate
.
logoParams
?.
logoUrl
||
null
,
bgmUrl
:
digitalTemplate
.
bgmParams
?.
bgmUrl
||
null
,
materialUrl
:
digitalTemplate
.
materialUrl
,
pronunciationLanguage
:
digital
CreationStore
.
pronunciationLanguage
,
pronunciationLanguage
:
digital
Template
.
ttsParams
?.
person
?
LangType
.
MANDARIN
:
LangType
.
CANTONESE
,
}
digitalCreationStore
.
updateDigitalCreation
(
draftConfig
)
audioSettingStore
.
setLanType
(
draftConfig
.
person
?
LangType
.
MANDARIN
:
LangType
.
CANTONESE
)
audioSettingStore
.
setVoiceType
(
draftConfig
.
person
?
VoiceType
.
MANDARIN_FEMALE
:
VoiceType
.
CANTONESE_FEMALE
)
}
}
...
...
@@ -88,7 +87,6 @@ async function getDraft(id: string) {
const
res
=
await
fetchDraftConfigById
<
DraftConfig
>
(
id
)
if
(
res
.
code
===
0
)
{
digitalCreationStore
.
updateDigitalCreation
(
res
.
data
)
audioSettingStore
.
setLanType
(
res
.
data
.
person
?
LangType
.
MANDARIN
:
LangType
.
CANTONESE
)
audioSettingStore
.
setVoiceType
(
res
.
data
.
person
?
VoiceType
.
MANDARIN_FEMALE
:
VoiceType
.
CANTONESE_FEMALE
)
}
}
...
...
@@ -127,10 +125,9 @@ async function getTaskConfig(id: string) {
logoUrl
:
res
.
data
.
logoUrl
||
digitalCreationStore
.
logoUrl
,
bgmUrl
:
res
.
data
.
bgmUrl
||
digitalCreationStore
.
bgmUrl
,
materialUrl
:
res
.
data
.
materialUrl
||
digitalCreationStore
.
materialUrl
,
pronunciationLanguage
:
res
.
data
.
p
ronunciationLanguage
||
digitalCreationStore
.
pronunciationLanguage
,
pronunciationLanguage
:
res
.
data
.
p
erson
?
LangType
.
MANDARIN
:
LangType
.
CANTONESE
,
}
digitalCreationStore
.
updateDigitalCreation
(
draftConfig
)
audioSettingStore
.
setLanType
(
draftConfig
.
person
?
LangType
.
MANDARIN
:
LangType
.
CANTONESE
)
audioSettingStore
.
setVoiceType
(
draftConfig
.
person
?
VoiceType
.
MANDARIN_FEMALE
:
VoiceType
.
CANTONESE_FEMALE
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment