Skip to content

resample error in python==3.14/numpy==2.4.2 #39

Description

@svilendobrev

the error is:

    r = samplerate.resample( y, ratio, res_type )  #simpleAPI

ValueError: cannot resize an array that references or is referenced
by another array in this way.
Use the np.resize function or refcheck=False

happens when ratio is non-int with fractional non-power-of-2 ( e.g. 3 works, 1.5 works, 1.51 does not).
e.g.

import samplerate,numpy
a = numpy.array( range( 44))
samplerate.resample( a, 1.51)

fails for numpy==2.4.2 but works ok with numpy==2.3.4

Note: the recent docs for numpy.resize mention something similar, may or may not be related: https://numpy.org/devdocs/reference/generated/numpy.ndarray.resize.html

Activity

  1. fakufaku commented on Mar 29, 2026

    @fakufaku
    Collaborator

    @svilendobrev This issue was raised in #35 and should have been fixed by #36 .

    I checked that your test code works with python 3.14.3, numpy 2.4.3, and samplerate 0.2.4.
    Could you please update to the latest version of samplerate (0.2.4) and try again?

  2. svilendobrev commented on Mar 30, 2026

    @svilendobrev
    Author

    hm. Yes. it works after re-installing. Seems some cached old version was in the way. Thank you and sorry for the noise

  3. fakufaku commented on Mar 30, 2026

    @fakufaku
    Collaborator

    No worries, happy this is solved easily!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions