Giter VIP home page Giter VIP logo

Comments (2)

mopoIo avatar mopoIo commented on July 25, 2024

I don't know python and sorry if this is bad github etiquette but this is how I would do it: Instead of using || as the split point, I would use : and ( and the last character (the : has a space next to it and the ( has a space behind it)

First step:
I would start by checking if the first character it's a (. If it is I would set a default voice and then I would check if the text next to it matches a playsound id such as 2) 3) 4) etc. If it matches then I would queue that sound then I would search for the next split point.
If it doesn't match I would set a default voice then I would search for the next split point.

If it doesn't start with ( I would check if the first word has a : next to it, if it does I would check if that word matches a voice-list, if it does match I would save that as the first voice, if it doesn't I would use a default voice. Then I would search for the next split point.

Split points:
if it's : i would check if the word behind it matches a voice-list, if it does I would save that voice as the next voice and I would remove the last word from the previous sentence (since the last word will be the voice id for the next sentence) and that would be the previous message (played with the previous saved voice). Then I would search for the next split point.
If it doesn't match I would use the voice I saved on the previous scan for the previous sentence, then I would search for the next split point.

if it's ( i would check if the text next to it matches a playsound id such as 2) 3) 4) etc. If it matches I would save the text behind it as a message (minus the () to play with the previous voice I saved and I would queue that sound then I would search for the next split point.
If it doesn't then I would read the previous sentence (minus the () with the previous voice and I would search for the next split point.

if it's the last character I would stop the text reading there.

This is probably the worst way of doing it but I've been scratching my brain and this is what I could come up with

from ai-tts-donations.

mmattbtw avatar mmattbtw commented on July 25, 2024

closing in favor of synced linear issue #501

from ai-tts-donations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.