feat: update HttpTTS link generation to use dynamic text and rate values, improve button label
This commit is contained in:
@@ -207,20 +207,16 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
// 复制HttpTTS链接按钮点击事件
|
||||
copyHttpTtsLinkButton.addEventListener('click', function() {
|
||||
const text = textInput.value.trim();
|
||||
if (!text) {
|
||||
showCustomAlert('请输入要转换的文本', 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
const voice = voiceSelect.value;
|
||||
const style = styleSelect.value;
|
||||
const rate = rateInput.value;
|
||||
const pitch = pitchInput.value;
|
||||
const apiKey = apiKeyInput.value.trim();
|
||||
const text = "{{java.encodeURI(speakText)}}";
|
||||
const rate = "{{speakSpeed*4}}";
|
||||
|
||||
// 构建HttpTTS链接
|
||||
let httpTtsLink = `${window.location.origin}${config.basePath}/tts?t=${encodeURIComponent(text)}&v=${voice}&r=${rate}&p=${pitch}&s=${style}`;
|
||||
let httpTtsLink = `${window.location.origin}${config.basePath}/tts?t=${text}&v=${voice}&r=${rate}&p=${pitch}&s=${style}`;
|
||||
|
||||
|
||||
// 添加API Key参数(如果有)
|
||||
if (apiKey) {
|
||||
|
||||
Reference in New Issue
Block a user