File tree 5 files changed +29
-4
lines changed
components/TtsVoicesConfig
parser/pipelineXmlConverter
5 files changed +29
-4
lines changed Original file line number Diff line number Diff line change
1
+ import { TtsConfig , TtsVoice } from 'shared/types/ttsConfig'
2
+
3
+ export function VoicePreview ( { voice } : { voice : TtsVoice } ) {
4
+ return < audio controls src = { voice . preview } > </ audio >
5
+ }
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { useWindowStore } from 'renderer/store'
6
6
import { TtsConfig , TtsVoice } from 'shared/types/ttsConfig'
7
7
import { Down , Up } from '../SvgIcons'
8
8
import { voicesTransliterations } from './voiceTransliterations'
9
+ import { VoicePreview } from './VoicePreview'
9
10
10
11
export function TtsVoicesConfigPane ( {
11
12
availableVoices,
@@ -338,6 +339,9 @@ export function TtsVoicesConfigPane({
338
339
}
339
340
.
340
341
</ p >
342
+ < VoicePreview
343
+ voice = { availableVoices . find ( ( v ) => v . id == voiceId ) }
344
+ > </ VoicePreview >
341
345
{ preferredVoices . find ( ( v ) => v . id == voiceId ) ? (
342
346
< p >
343
347
< i > This voice is already in your list.</ i >
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ $engineColWidth: 8rem;
106
106
.tts-voices-config {
107
107
display : flex ;
108
108
flex-direction : column ;
109
- gap : .5 rem ;
109
+ gap : .75 rem ;
110
110
height : 100% ;
111
111
112
112
.voice-filters {
@@ -122,11 +122,23 @@ $engineColWidth: 8rem;
122
122
}
123
123
}
124
124
.voice-details {
125
- display : flex ;
126
- flex-direction : row ;
125
+ display : grid ;
126
+ grid-template-areas : " desc preview"
127
+ " add add" ;
127
128
gap : 1rem ;
128
129
align-items :baseline ;
129
-
130
+ p {
131
+ grid-area : desc;
132
+ margin-top : .25rem ;
133
+ margin-bottom : 0 ;
134
+ }
135
+ button {
136
+ grid-area : add ;
137
+ }
138
+ audio {
139
+ grid-area : preview;
140
+ height : 1rem ;
141
+ }
130
142
button , label , input {
131
143
font-weight : normal ;
132
144
font-size : 1.1rem ;
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ function voiceElementToJson(voiceElm: Element): TtsVoice {
6
6
gender : voiceElm . getAttribute ( 'gender' ) ,
7
7
lang : voiceElm . getAttribute ( 'lang' ) ,
8
8
engine : voiceElm . getAttribute ( 'engine' ) ,
9
+ href : voiceElm . getAttribute ( 'href' ) ,
10
+ preview : voiceElm . getAttribute ( 'preview' ) ,
9
11
}
10
12
voice . id = `${ voice . engine } -${ voice . name } `
11
13
return voice
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ export type TtsVoice = {
5
5
gender : string
6
6
priority ?: number
7
7
id ?: string
8
+ href : string
9
+ preview : string
8
10
}
9
11
export type TtsEngineProperty = {
10
12
key : string
You can’t perform that action at this time.
0 commit comments