2

I have a Python script that produces a soundwave in the form of a list of floats.

However, the sample rate is 25kHz (or some other arbitrary number): I need to resample at 44.1kHz

One solution path is to export as WAV and then use Sox to upsample from the commandline.

Another solution path is to do everything in Python.

How can I do this?

(PS as usual I will edit the question and/or provide an answer myself if I figure it out)

EDIT: resampling, interpolating matrix

EDIT: http://urinieto.com/2011/05/audio-resampling-in-python/

(I'm still trying to figure out how/if I can use scipy.signal.resample)

Community
  • 1
  • 1
P i
  • 29,020
  • 36
  • 159
  • 267
  • 1
    you could use [`scipy.signal.resample`](http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.resample.html) – loopbackbee Feb 19 '14 at 15:05
  • 1
    scipy.signal.resample documentation says that it is only suitable for periodic waveforms, so it may not be my best choice – P i Feb 19 '14 at 21:56
  • @Pi You can add zero-padding to the signal before resampling, though – endolith Aug 01 '17 at 17:23

0 Answers0