Artrajz commited on
Commit
ff648e9
1 Parent(s): b5830b6
Files changed (1) hide show
  1. templates/index.html +5 -6
templates/index.html CHANGED
@@ -115,7 +115,7 @@
115
  Your browser does not support the audio element.
116
  </audio>
117
  <div class="form-group form-check">
118
- <input type="checkbox" id="streaming">
119
  <label class="form-check-label">流式响应</label>
120
  </div>
121
  </div>
@@ -210,6 +210,7 @@
210
  var noise = document.getElementById("inputNoise").value;
211
  var noisew = document.getElementById("inputNoisew").value;
212
  var max = document.getElementById("inputMax").value;
 
213
 
214
  var url = baseUrl + "/voice/vits?text=" + text + "&id=" + id;
215
  if (format != "") {
@@ -230,6 +231,9 @@
230
  if (max != "") {
231
  url += "&max=" + max;
232
  }
 
 
 
233
  return url;
234
  }
235
 
@@ -241,12 +245,7 @@
241
  }
242
 
243
  function setAudioSource() {
244
- var streaming = document.getElementById('streaming');
245
  var url = getLink();
246
- if (streaming.checked) {
247
- url += '&streaming=true';
248
- }
249
-
250
  var audioPlayer = document.getElementById("audioPlayer");
251
  audioPlayer.src = url;
252
  audioPlayer.play();
 
115
  Your browser does not support the audio element.
116
  </audio>
117
  <div class="form-group form-check">
118
+ <input type="checkbox" id="streaming" onchange="updateLink()">
119
  <label class="form-check-label">流式响应</label>
120
  </div>
121
  </div>
 
210
  var noise = document.getElementById("inputNoise").value;
211
  var noisew = document.getElementById("inputNoisew").value;
212
  var max = document.getElementById("inputMax").value;
213
+ var streaming = document.getElementById('streaming');
214
 
215
  var url = baseUrl + "/voice/vits?text=" + text + "&id=" + id;
216
  if (format != "") {
 
231
  if (max != "") {
232
  url += "&max=" + max;
233
  }
234
+ if (streaming.checked) {
235
+ url += '&streaming=true';
236
+ }
237
  return url;
238
  }
239
 
 
245
  }
246
 
247
  function setAudioSource() {
 
248
  var url = getLink();
 
 
 
 
249
  var audioPlayer = document.getElementById("audioPlayer");
250
  audioPlayer.src = url;
251
  audioPlayer.play();