Full STT and TTS.

This commit is contained in:
retoor 2025-06-29 19:58:40 +02:00
parent 1e6f8b9cd8
commit c366f8f0d3
3 changed files with 10 additions and 2 deletions

View File

@ -270,6 +270,13 @@ textToLeetAdvanced(text) {
this.appendChild(this.textarea);
this.ttsButton = document.createElement("stt-button");
this.snekSpeaker = document.createElement("snek-speaker");
this.appendChild(this.snekSpeaker);
this.ttsButton.addEventListener("click", (e) => {
this.snekSpeaker.enable()
});
this.appendChild(this.ttsButton);
this.uploadButton = document.createElement("upload-button");
this.uploadButton.setAttribute("channel", this.channelUid);

View File

@ -7,8 +7,8 @@
<title>Snek</title>
<style>{{highlight_styles}}</style>
<link rel="stylesheet" href="/file-upload-grid.css">
<script src="/njet.js" type="module"></script>
<script src="/tts.js" type="module"></script>
<script src="/stt.js" type="module"></script>
<script src="/file-upload-grid.js" type="module"></script>
<script src="/polyfills/Promise.withResolvers.js" type="module"></script>

View File

@ -215,6 +215,7 @@ app.addEventListener("channel-message", (data) => {
} else if (!isMentionForSomeoneElse(data.message)) {
if(data.is_final){
app.playSound("message");
document.querySelector("snek-speaker").speak(data.message);
}
}
}