Ejemplo n.º 1
0
def test_auresize(backend, size, channel_first, audio):
    _change_backend(backend)

    if channel_first:
        audio = audio.transpose((1, 0))

    resized_audio = audio_utils.auresize(
        audio, size, channel_first=channel_first)

    assert resized_audio.shape == size
Ejemplo n.º 2
0
def load_audio_pydub(path, shape=None, normalize=False):
    if shape:
        return auresize(auread(path), shape)
    return auread(path)