Skip to content

Raise more informative error when processing stereo tracks #41

@edward-io

Description

@edward-io

Thanks for converting crepe to PyTorch!

When running python -m torchcrepe --audio_files=..., I encountered the error:

  File "~/miniconda3/lib/python3.11/site-packages/torchcrepe/core.py", line 733, in resample
    audio = audio.detach().cpu().numpy().squeeze(0)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: cannot select an axis to squeeze out which has size not equal to one

Investigating the error, audio has shape torch.Size([2, 10674560]). Raising an exception when the input audio track is stereo (or downmix to mono) could be useful to other users of the project.

Thanks!

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