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

Voice changer choppy effect #4

Open
SuperZombi opened this issue Apr 11, 2023 · 0 comments
Open

Voice changer choppy effect #4

SuperZombi opened this issue Apr 11, 2023 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@SuperZombi
Copy link
Owner

I have a fairly powerful computer, but when processing, I get a choppy effect between chunks.
I tried increasing and decreasing the size of the chunks, but it does not help.

Now I'm changing pitch with librosa.pitch_shifter()

from librosa.effects import pitch_shift
...
def pitch_shift_callback(in_data, frame_count, time_info, status):
    pitch_value = 6
    audio_data = np.frombuffer(in_data, dtype=np.float32)
    shifted_audio_data = pitch_shift(audio_data, sr=44100, n_steps=pitch_value)
    out_data = shifted_audio_data.tobytes()
    return (out_data, pyaudio.paContinue)

...
p = pyaudio.PyAudio()
stream = p.open(format=pyaudio.paFloat32, channels=1, rate=44100,
        input_device_index=SETTINGS["INPUT_DEVICE"],
        output_device_index=SETTINGS["OUTPUT_DEVICE"],
        input=True, output=True,
        stream_callback=pitch_shift_callback,
        frames_per_buffer=2048)

But this choppy effect still appears, because I think so, between the chunks there are gaps a few milliseconds long, which takes resampling.

Does anyone know how this can be fixed? Help please.

@SuperZombi SuperZombi added the help wanted Extra attention is needed label Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant