@@ -22,8 +22,8 @@ const apiConfig = {
22
22
"Ethan" , "Emma" , "Ava" , "Lucas" , "Chloe" , "Caleb" , "Sofia" , "Gabriel" , "Ivy"
23
23
]
24
24
} ,
25
- leftsite : {
26
- url : "/api2 /tts" ,
25
+ voiceapi : {
26
+ url : "https://voiceapi.firefly.oy.lc /tts" ,
27
27
speakers : [
28
28
"zh-CN-XiaoxiaoMultilingualNeural" , "zh-CN-XiaoxiaoNeural" , "zh-CN-YunxiNeural" , "zh-CN-YunjianNeural" ,
29
29
"zh-CN-XiaoyiNeural" , "zh-CN-YunyangNeural" , "zh-CN-XiaochenNeural" , "zh-CN-XiaohanNeural" ,
@@ -48,8 +48,8 @@ function updateSpeakerOptions(apiName) {
48
48
speakerSelect . append ( new Option ( speaker , speaker ) ) ;
49
49
} ) ;
50
50
51
- const showAdditionalParams = apiName === 'leftsite ' ;
52
- $ ( '#leftsiteParams ' ) . toggle ( showAdditionalParams ) ;
51
+ const showAdditionalParams = apiName === 'voiceapi ' ;
52
+ $ ( '#voiceapiParams ' ) . toggle ( showAdditionalParams ) ;
53
53
}
54
54
55
55
function updateSliderLabel ( sliderId , labelId ) {
@@ -81,9 +81,9 @@ $(document).ready(function () {
81
81
const apiUrl = apiConfig [ apiName ] . url ;
82
82
const speaker = $ ( '#speaker' ) . val ( ) ;
83
83
const text = $ ( '#text' ) . val ( ) ;
84
-
85
84
let url = `${ apiUrl } ?text=${ encodeURIComponent ( text ) } &speak=${ speaker } ` ;
86
- if ( apiName === 'leftsite' ) {
85
+
86
+ if ( apiName === 'voiceapi' ) {
87
87
const rate = $ ( '#rate' ) . val ( ) ;
88
88
const pitch = $ ( '#pitch' ) . val ( ) ;
89
89
url += `&r=${ rate } &p=${ pitch } &o=audio-24khz-48kbitrate-mono-mp3` ;
@@ -100,7 +100,7 @@ $(document).ready(function () {
100
100
if ( apiName === 'aivoicenet' ) {
101
101
voiceUrl = response . voiceurl ;
102
102
} else {
103
- voiceUrl = URL . createObjectURL ( response ) ;
103
+ voiceUrl = url ;
104
104
}
105
105
106
106
$ ( '#audio' ) . attr ( 'src' , voiceUrl ) ;
0 commit comments