Skip to content

libsox does not detect mp3 when extension is missing #1040

@orlando-labs

Description

@orlando-labs

🐛 Bug

Sox IO backend doesn't allow to load file with explicit filetype while doesn't offer auto detection.

To Reproduce

Steps to reproduce the behavior:

>>> torchaudio.set_audio_backend("sox")
>>> torchaudio.load("/path/to/extensionless/file", filetype='mp3')
(tensor([[0., 0., 0.,  ..., 0., 0., 0.]]), 16000)
>>> torchaudio.set_audio_backend("sox_io")
>>> torchaudio.load("/path/to/extensionless/file", filetype='mp3')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: load() got an unexpected keyword argument 'filetype'
>>> torchaudio.load("/path/to/extensionless/file")
formats: can't determine type of file `/path/to/extensionless/file'

Expected behavior

Expected an autodetect feature or allowance to pass an explicit format argument

Environment

torch/torchaudio build from source. master of v0.7.0 affected

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions