Dmtlant commited on
Commit
f7a05cc
1 Parent(s): a4cc52f

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +8 -2
index.html CHANGED
@@ -75,7 +75,13 @@
75
  const textInput = document.getElementById('text-input').value;
76
  const response = await query({ "inputs": textInput });
77
  const audioBlob = response;
78
- // Use the audioBlob to play the speech or save it to a file
 
 
 
 
 
 
79
  console.log(audioBlob);
80
  }
81
 
@@ -106,4 +112,4 @@
106
  }
107
  </script>
108
  </body>
109
- </html>
 
75
  const textInput = document.getElementById('text-input').value;
76
  const response = await query({ "inputs": textInput });
77
  const audioBlob = response;
78
+ const audioUrl = URL.createObjectURL(audioBlob);
79
+
80
+ // Create an Audio object and set its src property to the Blob URL
81
+ const audio = new Audio(audioUrl);
82
+ audio.play();
83
+
84
+ // Log the audioBlob to the console
85
  console.log(audioBlob);
86
  }
87
 
 
112
  }
113
  </script>
114
  </body>
115
+ </html>