Giter Club home page Giter Club logo

Comments (4)

zx3253773818 avatar zx3253773818 commented on May 13, 2024

B4QD8LCJLAUC%FHC)L{CN 1

from tts-server-android.

jing332 avatar jing332 commented on May 13, 2024

这很明显是文本发过来时就是带空格的
检查阅读APP的净化和本APP的替换设置

from tts-server-android.

zx3253773818 avatar zx3253773818 commented on May 13, 2024

谢谢,通过替换空格,可以正常阅读了,文本是正常的,手机系统更新后出现的问题,更新后原先用的tts app也是单字读,不知道是阅读软件还是系统的问题😂。大佬软件好用的!👍👍

from tts-server-android.

caton-hpg avatar caton-hpg commented on May 13, 2024

我也用的fbreader,也有相同的问题。 咱们“朗读规则” 里 怎么去空格?

我改了下.replace(/ /g, '')没有效果:

let SpeechRuleJS = {
    name: "旁白/对话",
    id: "ttsrv.multi_voice",
    author: "TTS Server",
    version: 4,
    tags: {narration: "旁白", dialogue: "对话"},

    handleText(text) {
        const list = [];
        let tmpStr = "";
        let endTag = "narration";

        text.split("").forEach((char, index) => {
            tmpStr += char;

            if (char === '“') {
                endTag = "dialogue";
                list.push({text: tmpStr, tag: "narration"});
                tmpStr = "";
            } else if (char === '”') {
                endTag = "narration";
                tmpStr = tmpStr.slice(0, -1)
                list.push({text: tmpStr, tag: "dialogue"});
                tmpStr = "";
            } else if (index === text.length - 1) {
                list.push({text: tmpStr, tag: endTag});
            }
        });

        return list;
    },

    splitText(text) {
        let separatorStr = "。??!!;;"

        let list = []
        let tmpStr = ""
        text.split("").forEach((char, index) => {
            tmpStr += char

            if (separatorStr.includes(char)) {
                list.push(tmpStr)
                tmpStr = ""
            } else if (index === text.length - 1) {
                list.push(tmpStr);
            }
        })

        return list.filter(item =>  item.replace(/[“”]/g, '').replace(/ /g, '').trim().length > 0);
    }

};

from tts-server-android.

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.