@@ -8,14 +8,18 @@ import type { UnSpeechOptions, VoiceProviderWithExtraOptions } from '../types'
8
8
export interface UnVolcengineOptions {
9
9
app ?: {
10
10
appId ?: string
11
- cluster ?: string | 'volcano_tts'
12
- }
13
- user ?: {
14
- uid ?: string
11
+ cluster ?: 'volcano_tts' | string
15
12
}
16
13
audio ?: {
17
- emotion ?: string | 'angry'
18
- enableEmotion ?: boolean
14
+ /**
15
+ * @default 160
16
+ */
17
+ bitRate ?: 160 | number
18
+ /**
19
+ * Languages that contextual to the model
20
+ */
21
+ contextLanguage ?: 'es' | 'id' | 'pt' | string
22
+ emotion ?: 'angry' | string
19
23
/**
20
24
* After calling emotion to set the emotion parameter you can use emotion_scale to
21
25
* further set the emotion value, the range is 1~5, the default value is 4 when not
@@ -31,24 +35,11 @@ export interface UnVolcengineOptions {
31
35
* @default 4
32
36
*/
33
37
emotionScale ?: number
38
+ enableEmotion ?: boolean
34
39
/**
35
40
* @default 'mp3'
36
41
*/
37
- encoding ?: 'wav' | 'pcm' | 'ogg_opus' | 'mp3'
38
- /**
39
- * 0.8~2
40
- *
41
- * @default 1
42
- */
43
- speedRatio ?: number
44
- /**
45
- * @default 24000
46
- */
47
- rate ?: number | 24000 | 8000 | 16000
48
- /**
49
- * @default 160
50
- */
51
- bitRate ?: number | 160
42
+ encoding ?: 'mp3' | 'ogg_opus' | 'pcm' | 'wav'
52
43
/**
53
44
* - undefined: General mixed bilingual
54
45
* - crosslingual: mix with zh/en/ja/es-ms/id/pt-br
@@ -61,34 +52,43 @@ export interface UnVolcengineOptions {
61
52
*
62
53
* @default 'en'
63
54
*/
64
- explicitLanguage ?: string | 'crosslingual' | 'zh' | 'en' | 'jp' | 'es-mx' | 'id' | 'pt-br'
65
- /**
66
- * Languages that contextual to the model
67
- */
68
- contextLanguage ?: string | 'id' | 'es' | 'pt'
55
+ explicitLanguage ?: 'crosslingual' | 'en' | 'es-mx' | 'id' | 'jp' | 'pt-br' | 'zh' | string
69
56
/**
70
57
* 0.5 ~ 2
71
58
*
72
59
* @default 1
73
60
*/
74
61
loudnessRatio ?: number
62
+ /**
63
+ * @default 24000
64
+ */
65
+ rate ?: 8000 | 16000 | 24000 | number
66
+ /**
67
+ * 0.8~2
68
+ *
69
+ * @default 1
70
+ */
71
+ speedRatio ?: number
75
72
}
76
73
request ?: {
74
+ cacheConfig ?: Record < string , unknown >
75
+ disableMarkdownFilter ?: boolean
76
+ enableLatexTone ?: boolean
77
+ extraParam ?: string
77
78
reqid ?: string
78
- /**
79
- * - set to `ssml` to use SSML
80
- */
81
- textType ?: string | 'ssml'
82
79
/**
83
80
* 0 ~ 30000ms
84
81
*/
85
82
silenceDuration ?: number
86
- withTimestamp ?: string
87
- extraParam ?: string
88
- disableMarkdownFilter ?: boolean
89
- enableLatexTone ?: boolean
90
- cacheConfig ?: Record < string , unknown >
83
+ /**
84
+ * - set to `ssml` to use SSML
85
+ */
86
+ textType ?: 'ssml' | string
91
87
useCache ?: boolean
88
+ withTimestamp ?: string
89
+ }
90
+ user ?: {
91
+ uid ?: string
92
92
}
93
93
}
94
94
@@ -101,7 +101,6 @@ export interface UnVolcengineOptions {
101
101
* as ElevenLabs, Azure TTS, Google TTS, etc.
102
102
*
103
103
* @param apiKey - Volcano Engine Speech Service Token
104
- * @param appId - Volcano Engine Speech Service App ID
105
104
* @param baseURL - UnSpeech Instance URL
106
105
* @returns SpeechProviderWithExtraOptions
107
106
*/
@@ -156,7 +155,7 @@ export const createUnVolcengine = (apiKey: string, baseURL = 'http://localhost:5
156
155
}
157
156
158
157
return {
159
- query : ` provider=volcengine` ,
158
+ query : ' provider=volcengine' ,
160
159
...( options ? toUnSpeechOptions ( options ) : { } ) ,
161
160
apiKey,
162
161
baseURL,
0 commit comments