Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bark Speech integration #23

Closed
appatalks opened this issue May 1, 2023 · 3 comments
Closed

Bark Speech integration #23

appatalks opened this issue May 1, 2023 · 3 comments

Comments

@appatalks
Copy link
Owner

Very close:

<button onclick="barkTTS()">Click me</button>

<audio id="audioPlayer" type="audio/wav"></audio>

<script>
  function barkTTS() {
    const url = 'http:https://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
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

Happy with current implementation. Will revisit later when more matured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant