question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

libsox does not detect mp3 when extension is missing

See original GitHub issue

🐛 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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
mthrokcommented, Dec 17, 2020

Thanks, confirmed the issue. I will come back with the solution.

0reactions
orlando-labscommented, Dec 22, 2020

Hi, @mthrok. Sure, I’ll try it tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SOLVED] Sox errors playing mp3 files even with libsox-fmt ...
I tried to play an MP3 file from the command line with the play invocation of the sox command. The stock install of...
Read more >
How to add a mp3 handler to sox? - ubuntu
Show activity on this post. Pipe? lame --decode music.mp3 - | play -. Won't leave any trace. ... sudo apt-get install libsox-fmt-mp3.
Read more >
Sox + MP3: libsox-fmt-mp3 not working
For me the problem is that I was receiving an audio stream that I thought was mp3 but which was actually aac ....
Read more >
sox returns an error when I try to handle mp3 files
when I do yum install lame, it returns package not found.it says sox installed.but no lame package lame available. – cppit. Nov 2,...
Read more >
SoX error while extracting bin/import_cv.py · Issue #1195
I've installed SoX from pip install -r requirements, but it gives me this error. sh: 1: sox: not found SoX could not be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found