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
You need to sign in or sign up before continuing.
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'
import
{
defineStore
}
from
'pinia'
function
defaultAudioSetting
():
AudioConfig
{
function
defaultAudioSetting
():
AudioConfig
{
return
{
return
{
langType
:
LangType
.
CANTONESE
,
voiceType
:
VoiceType
.
CANTONESE_FEMALE
,
voiceType
:
VoiceType
.
CANTONESE_FEMALE
,
consumption
:
0
,
consumption
:
0
,
}
}
...
@@ -17,10 +16,6 @@ export const useAudioSettingStore = defineStore('audio-setting-store', {
...
@@ -17,10 +16,6 @@ export const useAudioSettingStore = defineStore('audio-setting-store', {
state
:
():
AudioConfig
=>
getLocalState
(),
state
:
():
AudioConfig
=>
getLocalState
(),
actions
:
{
actions
:
{
setLanType
(
langType
:
LangType
)
{
this
.
langType
=
langType
},
setVoiceType
(
voiceType
:
VoiceType
)
{
setVoiceType
(
voiceType
:
VoiceType
)
{
this
.
voiceType
=
voiceType
this
.
voiceType
=
voiceType
},
},
...
...
src/store/modules/creation.ts
View file @
d22c5c4d
...
@@ -114,6 +114,10 @@ export const useDigitalCreationStore = defineStore('digital-creation-store', {
...
@@ -114,6 +114,10 @@ export const useDigitalCreationStore = defineStore('digital-creation-store', {
this
.
enabled
=
subtitleEnabled
this
.
enabled
=
subtitleEnabled
},
},
setPronunciationLanguage
(
pronunciationLanguage
:
LangType
)
{
this
.
pronunciationLanguage
=
pronunciationLanguage
},
updateDigitalCreation
(
digitalCreation
:
Partial
<
DraftConfig
>
)
{
updateDigitalCreation
(
digitalCreation
:
Partial
<
DraftConfig
>
)
{
this
.
$state
=
{
...
this
.
$state
,
...
digitalCreation
}
this
.
$state
=
{
...
this
.
$state
,
...
digitalCreation
}
},
},
...
...
src/store/types/creation.ts
View file @
d22c5c4d
...
@@ -28,7 +28,6 @@ export enum VoiceType {
...
@@ -28,7 +28,6 @@ export enum VoiceType {
}
}
export
interface
AudioConfig
{
export
interface
AudioConfig
{
langType
:
LangType
voiceType
:
VoiceType
voiceType
:
VoiceType
consumption
:
number
consumption
:
number
}
}
...
...
src/views/creation/components/digital/digital-audio.vue
View file @
d22c5c4d
...
@@ -42,10 +42,10 @@ const showAll = ref(false)
...
@@ -42,10 +42,10 @@ const showAll = ref(false)
const
langType
=
computed
({
const
langType
=
computed
({
get
()
{
get
()
{
return
audioSettingStore
.
langTyp
e
return
digitalCreationStore
.
pronunciationLanguag
e
},
},
set
(
value
)
{
set
(
value
)
{
audioSettingStore
.
setLanTyp
e
(
value
)
digitalCreationStore
.
setPronunciationLanguag
e
(
value
)
},
},
})
})
...
@@ -94,6 +94,7 @@ watch(
...
@@ -94,6 +94,7 @@ watch(
watch
(
watch
(
()
=>
langType
.
value
,
()
=>
langType
.
value
,
(
newVal
)
=>
{
(
newVal
)
=>
{
digitalCreationStore
.
setInputAudioUrl
(
''
)
if
(
newVal
===
LangType
.
CANTONESE
)
{
if
(
newVal
===
LangType
.
CANTONESE
)
{
digitalCreationStore
.
setPerson
(
''
)
digitalCreationStore
.
setPerson
(
''
)
audioSettingStore
.
setVoiceType
(
VoiceType
.
CANTONESE_FEMALE
)
audioSettingStore
.
setVoiceType
(
VoiceType
.
CANTONESE_FEMALE
)
...
...
src/views/creation/components/preview-content.vue
View file @
d22c5c4d
...
@@ -123,7 +123,7 @@ function controlAudio() {
...
@@ -123,7 +123,7 @@ function controlAudio() {
audioSetting
.
value
.
voiceType
!==
audioSettingStore
.
voiceType
||
audioSetting
.
value
.
voiceType
!==
audioSettingStore
.
voiceType
||
audioSetting
.
value
.
speed
!==
ttsSpeedMarks
[
digitalCreationStore
.
speed
]
||
audioSetting
.
value
.
speed
!==
ttsSpeedMarks
[
digitalCreationStore
.
speed
]
||
audioSetting
.
value
.
volume
!==
Number
(
digitalCreationStore
.
volume
)
||
audioSetting
.
value
.
volume
!==
Number
(
digitalCreationStore
.
volume
)
||
(
audioSettingStore
.
langTyp
e
===
LangType
.
MANDARIN
&&
(
digitalCreationStore
.
pronunciationLanguag
e
===
LangType
.
MANDARIN
&&
audioSetting
.
value
.
pitch
!==
Number
(
digitalCreationStore
.
pitch
))
audioSetting
.
value
.
pitch
!==
Number
(
digitalCreationStore
.
pitch
))
)
{
)
{
audioData
.
value
=
''
audioData
.
value
=
''
...
...
src/views/creation/layout/index.vue
View file @
d22c5c4d
...
@@ -76,10 +76,9 @@ async function getDigitalTemplate(id: string) {
...
@@ -76,10 +76,9 @@ async function getDigitalTemplate(id: string) {
logoUrl
:
digitalTemplate
.
logoParams
?.
logoUrl
||
null
,
logoUrl
:
digitalTemplate
.
logoParams
?.
logoUrl
||
null
,
bgmUrl
:
digitalTemplate
.
bgmParams
?.
bgmUrl
||
null
,
bgmUrl
:
digitalTemplate
.
bgmParams
?.
bgmUrl
||
null
,
materialUrl
:
digitalTemplate
.
materialUrl
,
materialUrl
:
digitalTemplate
.
materialUrl
,
pronunciationLanguage
:
digital
CreationStore
.
pronunciationLanguage
,
pronunciationLanguage
:
digital
Template
.
ttsParams
?.
person
?
LangType
.
MANDARIN
:
LangType
.
CANTONESE
,
}
}
digitalCreationStore
.
updateDigitalCreation
(
draftConfig
)
digitalCreationStore
.
updateDigitalCreation
(
draftConfig
)
audioSettingStore
.
setLanType
(
draftConfig
.
person
?
LangType
.
MANDARIN
:
LangType
.
CANTONESE
)
audioSettingStore
.
setVoiceType
(
draftConfig
.
person
?
VoiceType
.
MANDARIN_FEMALE
:
VoiceType
.
CANTONESE_FEMALE
)
audioSettingStore
.
setVoiceType
(
draftConfig
.
person
?
VoiceType
.
MANDARIN_FEMALE
:
VoiceType
.
CANTONESE_FEMALE
)
}
}
}
}
...
@@ -88,7 +87,6 @@ async function getDraft(id: string) {
...
@@ -88,7 +87,6 @@ async function getDraft(id: string) {
const
res
=
await
fetchDraftConfigById
<
DraftConfig
>
(
id
)
const
res
=
await
fetchDraftConfigById
<
DraftConfig
>
(
id
)
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
digitalCreationStore
.
updateDigitalCreation
(
res
.
data
)
digitalCreationStore
.
updateDigitalCreation
(
res
.
data
)
audioSettingStore
.
setLanType
(
res
.
data
.
person
?
LangType
.
MANDARIN
:
LangType
.
CANTONESE
)
audioSettingStore
.
setVoiceType
(
res
.
data
.
person
?
VoiceType
.
MANDARIN_FEMALE
:
VoiceType
.
CANTONESE_FEMALE
)
audioSettingStore
.
setVoiceType
(
res
.
data
.
person
?
VoiceType
.
MANDARIN_FEMALE
:
VoiceType
.
CANTONESE_FEMALE
)
}
}
}
}
...
@@ -127,10 +125,9 @@ async function getTaskConfig(id: string) {
...
@@ -127,10 +125,9 @@ async function getTaskConfig(id: string) {
logoUrl
:
res
.
data
.
logoUrl
||
digitalCreationStore
.
logoUrl
,
logoUrl
:
res
.
data
.
logoUrl
||
digitalCreationStore
.
logoUrl
,
bgmUrl
:
res
.
data
.
bgmUrl
||
digitalCreationStore
.
bgmUrl
,
bgmUrl
:
res
.
data
.
bgmUrl
||
digitalCreationStore
.
bgmUrl
,
materialUrl
:
res
.
data
.
materialUrl
||
digitalCreationStore
.
materialUrl
,
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
)
digitalCreationStore
.
updateDigitalCreation
(
draftConfig
)
audioSettingStore
.
setLanType
(
draftConfig
.
person
?
LangType
.
MANDARIN
:
LangType
.
CANTONESE
)
audioSettingStore
.
setVoiceType
(
draftConfig
.
person
?
VoiceType
.
MANDARIN_FEMALE
:
VoiceType
.
CANTONESE_FEMALE
)
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