CouncilDataProject / CouncilDataProject/speakerbox

`AudioSegment.from_file` is not restricted to WAV files

Open
#14 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
61
Forks
6
PR merge metrics
No merged PRs in 30d

Description

### Feature Description
In `preprocess.py`, you use `AudioSegment.from_file` to load the audio files. According to [definition](https://github.com/jiaaro/pydub#quickstart) of this function, it seems it accepts a bunch of file formats.
but at the previous line, you restrict the user to wav files `for ... in label_dir.glob("*.wav")`
Is there a reason to that? Mp3/ogg/etc. files would be useful, as they take less place on the disk.

### Use Case
Basic `preprocess` then `train`, as in README.

### Solution
replace `.glob('*wav')` by a list of formats pydub accepts. I didn't find a list yet, but [the implementation](https://github.com/jiaaro/pydub/blob/3cee07e77d9fed6901c18b72b648c80a457bc886/pydub/audio_segment.py#L645) of `from_file` gives us some hints of the formats accepted.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.