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

Changing sample rate on the fly? #91

Open
Castor215 opened this issue Sep 4, 2023 · 1 comment
Open

Changing sample rate on the fly? #91

Castor215 opened this issue Sep 4, 2023 · 1 comment

Comments

@Castor215
Copy link

Castor215 commented Sep 4, 2023

I am trying to port some code from SoundTouch to rubberband. The SoundTouch object has the method setSampleRate to change the sample rate after construction. I was wondering if rubberband has an equivalent way to do this? Do I have to destroy the rubberband object and create a new one if the sample rate is to be changed?

@cannam
Copy link
Member

cannam commented Sep 12, 2023

There isn't any way to do this with Rubber Band - the sample rate is fundamental to the setup of the stretcher, so you have to destroy and recreate it.

(If you are switching only between 44100 and 48000 Hz, you might get away without doing this at all. The rate doesn't affect the amount of change to pitch and time, only the quality, and a change of rate within this limited range makes only a small difference to that. So in an emergency, you can use a stretcher constructed for 44100 at 48000 instead, or vice versa, and it should still sound ok. But with more divergent rates, that won't sound good.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants