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 modify the interval time between two sentence? #352

Open
weixuejun2008 opened this issue Jan 9, 2025 · 3 comments
Open

how to modify the interval time between two sentence? #352

weixuejun2008 opened this issue Jan 9, 2025 · 3 comments
Labels
question Further information is requested

Comments

@weixuejun2008
Copy link

how to modify the interval time between two sentence?

Copy link

dosubot bot commented Jan 9, 2025

To modify the interval time between two sentences in the OpenVoice project, you can adjust the speed parameter in the audio_numpy_concat method. This method is responsible for concatenating audio segments and adding silence between them. The speed parameter affects the duration of the silence added between sentences. Here's the relevant code snippet:

@staticmethod
def audio_numpy_concat(segment_data_list, sr, speed=1.):
    audio_segments = []
    for segment_data in segment_data_list:
        audio_segments += segment_data.reshape(-1).tolist()
        audio_segments += [0] * int((sr * 0.05)/speed)
    audio_segments = np.array(audio_segments).astype(np.float32)
    return audio_segments

By adjusting the speed parameter, you can control the length of the pause between sentences. A lower speed value will increase the interval, while a higher value will decrease it [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 9, 2025
@weixuejun2008
Copy link
Author

when I modify the speed parameter ,from “audio_numpy_concat(segment_data_list, sr, speed=1.)” to “audio_numpy_concat(segment_data_list, sr, speed=0.5)” ,but the interval do not become longer.how can I do ?

Copy link

dosubot bot commented Jan 9, 2025

When you modify the speed parameter from 1 to 0.5 in the audio_numpy_concat method, the interval between sentences should increase because the silence duration is calculated as [0] * int((sr * 0.05)/speed), effectively doubling the silence when speed is set to 0.5 [1]. If the interval does not become longer, consider checking the following:

  1. Ensure Correct Method Usage: Verify that the audio_numpy_concat method is being called correctly with the modified speed parameter throughout the codebase. The method should be invoked with the intended speed value wherever it is used [1].

  2. Check for Overriding Code: Look for any other parts of the code that might override or affect the speed parameter after it is set. There might be additional logic that resets or ignores the changes made to the speed parameter.

  3. Review Configuration Settings: Ensure there are no configuration files or settings that might affect the behavior of the audio_numpy_concat method, potentially overriding the speed parameter.

By addressing these points, you should be able to identify why the interval is not changing as expected.

To continue talking to Dosu, mention @dosu.


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

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