resample()¶
- audresample.resample(signal, original_rate, target_rate, *, quality='h', always_copy=False)[source]¶
Resample signal to a new sampling rate.
Supports only signals in single precision floating point format. The returned signal is always of shape (
channels
,samples
).- Parameters
signal (
ndarray
) – array with signal valuesoriginal_rate (
int
) – original sample rate of the input signal in Hztarget_rate (
int
) – target sampling rate in Hzquality (
ResampleQuality
) – quality of the conversion algorithmalways_copy (
bool
) – ifTrue
always returns a new object
- Return type
- Returns
resampled signal with shape
(number of channels, number of samples)
- Raises
RuntimeError – if input signal has more than two dimensions
RuntimeError – if input type is not
numpy.single