Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CharIP-Electron
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
ali
CharIP-Electron
Commits
3d9e9744
Commit
3d9e9744
authored
Nov 29, 2023
by
ali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: vosk 配置提前加载
parent
0aff8cf0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
12 deletions
+21
-12
HeaderLayout.vue
src/renderer/components/layout/HeaderLayout.vue
+19
-9
ShowPhoto.vue
src/renderer/screens/ShowPhoto.vue
+0
-3
settings.ts
src/renderer/store/settings.ts
+2
-0
No files found.
src/renderer/components/layout/HeaderLayout.vue
View file @
3d9e9744
...
...
@@ -101,6 +101,14 @@ changeVoskModel();
required
></v-select>
<v-select
v-model=
"setting.tts.value"
:items=
"['xf_tts', 'local_tts']"
:rules=
"[(v) => !!v || '请选择 TTS']"
label=
"文字转语音(TTS)"
required
></v-select>
<template
v-if=
"asrSelect === 'vosk_asr'"
>
<v-select
v-model=
"setting.voskSelectModel.value"
...
...
@@ -113,6 +121,17 @@ changeVoskModel();
></v-select>
</
template
>
<
template
v-if=
"setting.tts.value === 'xf_tts'"
>
<v-select
v-model=
"setting.selectSource.value"
:items=
"source"
:rules=
"[(v) => !!v || '请选择音色']"
label=
"TTS 音色"
required
@
update:model-value=
"changeSource"
></v-select>
</
template
>
<v-text-field
label=
"TTS 域名"
:rules=
"[(value) => !!value || 'TTS 域名必填']"
...
...
@@ -120,15 +139,6 @@ changeVoskModel();
:model-value=
"setting.ttsHost"
></v-text-field>
<v-select
v-model=
"setting.selectSource.value"
class=
"mt-6"
:items=
"source"
:rules=
"[(v) => !!v || '请选择音色']"
label=
"TTS 音色"
required
@
update:model-value=
"changeSource"
></v-select>
<v-switch
v-model=
"setting.isFullscreen.value"
...
...
src/renderer/screens/ShowPhoto.vue
View file @
3d9e9744
...
...
@@ -24,11 +24,9 @@ router.beforeEach((g) => {
const
microphoneState
=
ref
<
'waitInput'
|
'input'
|
'loading'
|
'disabled'
>
(
'waitInput'
)
async
function
initVosk
({
modelPath
,
result
,
partialResult
}:
{
modelPath
:
string
result
?:
(
string
)
=>
void
partialResult
?:
(
string
)
=>
void
})
{
...
...
@@ -102,7 +100,6 @@ async function startAudioInput() {
microphoneState
.
value
=
'loading'
const
{
recognizer
,
channel
}
=
await
initVosk
({
modelPath
:
`https://resources.laihua.com/2023-11-29/
${
settings
.
voskSelectModel
}
`
,
result
:
async
(
text
)
=>
{
console
.
log
(
'----------------> text:'
,
text
)
const
tone
=
settings
.
source
.
find
(({
sourceId
})
=>
settings
.
selectSource
===
sourceId
)
...
...
src/renderer/store/settings.ts
View file @
3d9e9744
...
...
@@ -10,6 +10,7 @@ export type ISettings = {
asr
:
'vosk_asr'
|
'xf_asr'
voskModels
:
string
[]
voskSelectModel
:
string
tts
:
'xf_tts'
|
'local_tts'
,
ttsHost
:
string
source
:
{
sourceName
:
string
...
...
@@ -28,6 +29,7 @@ const useSettingsStore = defineStore('settings', {
state
:
()
=>
({
asr
:
'vosk_asr'
,
tts
:
'xf_tts'
,
voskModels
:
[
'vosk-model-small-ca-0.4.tar.gz'
,
'vosk-model-small-cn-0.3.tar.gz'
,
...
...
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