-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add double buffering to RawSample #9421
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question. Thanks for the PR!
Revised >>> mix.play(single_buffer=True, loop=True)
(200, 1, 0)
(400, 0, 1)
(100, 1, 1)
>>> mix.play(single_buffer=False, loop=True)
(200, 1, 0)
(400, 0, 1)
(100, 1, 1)
>>> mix.play(single_buffer=True, loop=False)
(200, 1, 0)
(400, 0, 1)
(100, 1, 1)
>>> mix.play(single_buffer=False, loop=False)
(200, 1, 0)
(400, 0, 1)
(100, 1, 1) Looking at the size and timing of the buffers pulled in by The pattern repeats every 10000 us, as you'd expect for an 80 sample With double buffered transfers, you see twice as many transfers that are half as big (and take half the time), which makes sense: For the examples above, the parameters are chosen such that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thank you!
This PR contains part of the changes necessary to implement the processing of live sampled audio as described in #2676. Here
audiocore.RawSample
is changed so that the sample can present itself either as a full-length single-buffered object or as a double-buffered object comprised of two half-length buffers.