Skip to content

Changes buffer resize to a view.#36

Merged
tuxu merged 6 commits intomasterfrom
fix/issue35
Mar 22, 2026
Merged

Changes buffer resize to a view.#36
tuxu merged 6 commits intomasterfrom
fix/issue35

Conversation

@fakufaku
Copy link
Copy Markdown
Collaborator

Sometimes the buffer returned by libsamplerate is slightly shorter than expected.
In this case, the length needs to be adjusted before it is returned.
So far, a call to numpy.resize was used. However, this is causing problems with newer versions of python.
This PR changes the code to create a view of the correct size.
This has the added benefit of not triggering a reallocation of the buffer.

Copy link
Copy Markdown
Owner

@tuxu tuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just a few suggestions.

@fakufaku
Copy link
Copy Markdown
Collaborator Author

Thanks for the quick review. Fixed as you suggested.

@tuxu tuxu merged commit 06e88d1 into master Mar 22, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants