Bark Speech integration
Closed this issue · 3 comments
appatalks commented
Very close:
<button onclick="barkTTS()">Click me</button>
<audio id="audioPlayer" type="audio/wav"></audio>
<script>
function barkTTS() {
const url = 'http://127.0.0.1:8080/send-string';
const data = txtOutput.innerHTML;
const xhr = new XMLHttpRequest();
xhr.responseType = 'blob';
xhr.onload = function() {
const audioElement = new Audio("./audio/bark_audio.wav");
audioElement.play();
}
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'text/plain');
xhr.send(data);
}
</script>
https://github.com/servingbaby/Bark_text-to-speech
https://github.com/suno-ai/bark
appatalks commented
Added to main. Currently I am unable to use the auto-speech function.
Need to figure out how to handle the audio file. Challenge is trying to deleting it or using in memory as it sometimes talks over itself from previous file generation.
appatalks commented
Another issue, Android Browsers (except for "Firefox Focus") don't seem to honor no cache rules - so the old wav file keeps getting played.
appatalks commented
Happy with current implementation. Will revisit later when more matured.