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

calling 'retrieve multiple times #114

Open
scar20 opened this issue Feb 21, 2025 · 0 comments
Open

calling 'retrieve multiple times #114

scar20 opened this issue Feb 21, 2025 · 0 comments

Comments

@scar20
Copy link

scar20 commented Feb 21, 2025

It is possible to call 'retrieve' with a small buffer until all available are consumed?
I'm on trying to integrate RB into MWEngine (an android DSP lib) and it use fixed buffer architecture which are called in a timely manner. The class in which it interact is 'SampleEvent' which setup sample parameters (start point, end point, loopin, etc) and playback from a method 'mixBuffer(outputBuffer)' which should fill outputBuffer. This method is called from aaudio on android.

I've been able to construct a complicated setup involving circular buffer to collect the retrieved sample and copy to outputBuffer but on more extreme settings of timeRatio and pitchScale, the amount of available become huge and I have to set unreasonably large circular buffer (32k). So I was wondering if I could instead use smaller buffer (size of outputBuffer ~1024) and call retrieve repeatedly until all available have been consumed. I tried this approach and up to now it did not work although I cant tell if its because I messed up my logic or it is simply because 'retreive' cannot be called more than once.

This is a very simplified overview of the code but if needed, I made a 'mock' of this setup on Ubuntu dealing only with this class and RB (and SRC too) that I did not upload on github yet. Right now, with the circular buffer setup, if timeRatio and pitchScale are in the range of 0.25 to 4.0, it work very well but is very expensive with mutliple buffers layers. In more extreme case with pitch 0.0125 and time 16.0 it still work but I begin to get buffer underruns at pitch over 8.0.

Thanks for your wonderful library, I never heard a stretcher that sound as good as this.

Syvain Carette

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

1 participant