def convert_audio(wav, from_samplerate, to_samplerate, channels) -> torch.Tensor:
    """Convert audio from a given samplerate to a target one and target number of channels."""
    wav = convert_audio_channels(wav, channels)
    return julius.resample_frac(wav, from_samplerate, to_samplerate)
Convert audio from a given samplerate to a target one and target number of channels.
demucs/audio.py