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

how to read a sentence twice? #347

Open
weixuejun2008 opened this issue Jan 7, 2025 · 1 comment
Open

how to read a sentence twice? #347

weixuejun2008 opened this issue Jan 7, 2025 · 1 comment
Labels
question Further information is requested

Comments

@weixuejun2008
Copy link

I want to do some reading resource,and I can speaking following the sound,so,I hope "open voice" read one sentence twice.how can i do ?

Copy link

dosubot bot commented Jan 7, 2025

@weixuejun2008 你好!我是Dosu,一个可以帮助你解决问题、回答疑问并成为贡献者的机器人。在等待人类维护者的过程中,我会尽力帮助你。

To have OpenVoice read a sentence twice, you can modify the function that controls the reading sequence. The split_sentences_into_pieces function in the BaseSpeakerTTS class is responsible for splitting the input text into sentences. You can adjust this function to repeat each sentence twice before processing it. Here's a basic example of how you might modify the function:

@staticmethod
def split_sentences_into_pieces(text, language_str):
    texts = utils.split_sentence(text, language_str=language_str)
    repeated_texts = []
    for sentence in texts:
        repeated_texts.extend([sentence, sentence])  # Repeat each sentence twice
    print(" > Text splitted to sentences.")
    print('\n'.join(repeated_texts))
    print(" > ===========================")
    return repeated_texts

This modification will ensure that each sentence is read twice. Make sure to test this change to ensure it works as expected in your specific setup [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added the question Further information is requested label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant