@@ -3,13 +3,13 @@ const apiConfig = {
3
3
url : "https://api.pearktrue.cn/api/aivoicenet" ,
4
4
speakers : [
5
5
"宇祥" , "宇蓝" , "蕊柔" , "宇智" , "宇希" , "希儿" , "蕊诗" , "蕊雪" , "蕊姗" , "珊儿" ,
6
- "婉儿" , "智宸" , "宇昊" , "宇铭" , "宇伟" , "紫瑶" , "紫阿" , "紫雪" , "紫娜" , "紫芸" ,
6
+ "婉儿" , "智宸" , "宇昊" , "宇铭" , "宇伟" , "紫瑶" , "紫阿" , "紫雪" , "紫娜" , "紫芸" ,
7
7
"宇全" , "玲儿" , "艾婷" , "宇诚" , "宇盛" , "宇栋" , "宇光" , "艾琳" , "艾莉" , "艾雯" ,
8
8
"艾诗" , "宇驰" , "艾薇" , "艾洁" , "艾蕊" , "宇骏" , "宇康" , "艾悦" , "艾冉" , "艾楠" ,
9
9
"宇铭" , "艾婧" , "艾露" , "艾思" , "艾媛" , "艾茜" , "艾菲" , "艾雅" , "宇泽" , "艾冉-情感女声" ,
10
- "晓萱-情感女声" , "晓辰-知性女生" , "晓晓-情感" , "晓伊-儿童音" , "云健-情感男声" , "云夏-儿童音" ,
10
+ "晓萱-情感女声" , "晓辰-知性女生" , "晓晓-情感" , "晓伊-儿童音" , "云健-情感男声" , "云夏-儿童音" ,
11
11
"云扬-青年男声" , "云希-解说小帅" , "晓贝-东北" , "晓妮-陕西" , "晓枫-情感女声" , "晓新-情感女声" ,
12
- "云辰-台湾" , "沁荷" , "芸语" , "语嫣" , "蕊珠" , "沁娜" , "沁蕾" , "宇璋" , "馨月" , "馨兰" ,
12
+ "云辰-台湾" , "沁荷" , "芸语" , "语嫣" , "蕊珠" , "沁娜" , "沁蕾" , "宇璋" , "馨月" , "馨兰" ,
13
13
"宇尚" , "宇同" , "馨欣" , "馨瑶" , "宇韦" , "宇晋" , "蕊芬" , "宇晋" , "蕊莉" , "沁雨" ,
14
14
"沁香" , "宇康" , "馨逸" , "沁莲" , "宇栋" , "馨荣" , "芸渲" , "芸露" , "芸梅" , "蕊若" ,
15
15
"蕊晗" , "沁美" , "芸柔" , "蕊韵" , "宇彦" , "芸茜" , "蕊诗" , "晓墨-青年女声" , "云枫-磁性男声" ,
@@ -145,7 +145,9 @@ function generateVoice(isPreview) {
145
145
$ ( '#audio' ) [ 0 ] . load ( ) ; // 确保加载音频文件
146
146
if ( ! isPreview ) {
147
147
$ ( '#download' ) . attr ( 'href' , voiceUrl ) ;
148
- addHistoryItem ( text , voiceUrl ) ;
148
+ const timestamp = new Date ( ) . toLocaleTimeString ( ) ; // 获取当前时间
149
+ const shortenedText = text . length > 10 ? text . substring ( 0 , 10 ) + '...' : text ;
150
+ addHistoryItem ( timestamp , shortenedText , voiceUrl ) ;
149
151
}
150
152
$ ( '#result' ) . show ( ) ;
151
153
$ ( '#loading' ) . hide ( ) ;
@@ -161,11 +163,11 @@ function generateVoice(isPreview) {
161
163
} ) ;
162
164
}
163
165
164
- function addHistoryItem ( text , audioURL ) {
166
+ function addHistoryItem ( timestamp , text , audioURL ) {
165
167
const historyItems = $ ( '#historyItems' ) ;
166
168
const historyItem = $ ( `
167
169
<div class="history-item">
168
- <span>${ text } </span>
170
+ <span>${ timestamp } - ${ text } </span>
169
171
<div>
170
172
<button class="btn btn-secondary" onclick="playAudio('${ audioURL } ')">播放</button>
171
173
<button class="btn btn-info" onclick="downloadAudio('${ audioURL } ')">下载</button>
@@ -191,4 +193,5 @@ function downloadAudio(audioURL) {
191
193
192
194
function clearHistory ( ) {
193
195
$ ( '#historyItems' ) . empty ( ) ;
196
+ alert ( "历史记录已清除!" ) ;
194
197
}
0 commit comments