pytorch / pytorch/audio

Add support for bitrate in sox_io backend

Open
#1,722 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
799
Avg merge
58m
Merged PRs (30d)
3

Description

soxi shows the files bitrate, but I'm pretty sure torchaudio.info doesn't when using the sox_io backend.

🚀 Feature

Create functionality within torchaudio.info and the AudioMetadata object to be able to determine a files bitrate.

Motivation

I want to be able to easily determine the bitrate within torchaudio so that I can do EDA and see if bitrate of audios has an impact on inference (e.g. if train set audios are all high bitrate but inference is low bitrate, will it lower accuracy?) If so then knowing the bitrates of the audios is important so that you can do proper augmentation to prevent the decreased accuracy.

Pitch

soxi shows bitrate, but as far as I can tell, torchaudio.info using the sox_io backend doesn't. Make torchaudio.info have the same data as soxi when using the sox_io_backend

Alternatives

I tried doing this outside of torchaudio with pydub, mutagen, file (command line) and soxi but it would be better if everything could be done with torchaudio. Thank you.

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the torchaudio.info and AudioMetadata entry points, then compare the sox_io metadata they expose with the bitrate reported by soxi. Done means torchaudio.info using sox_io can determine and expose a file's bitrate through AudioMetadata.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
audio-video-rtc
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.