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.

Use soundfile for primary IO, fall back on audioread in emergencies

See original GitHub issue

Description

As noted too many times in the issues to keep track of, the current audioread-based loader is both inefficient and somewhat finnicky across platforms and with varying back-end codec configurations. My recommendation has long been to use soundfile unless mp3 support is absolutely necessary, and plan to eventually switch over to soundfile in librosa once mp3 support is merged.

That said, there’s no reason we couldn’t have a soft dependency on soundfile as a first-pass attempt to load the data, and only fall back to audioread if soundfile fails for some reason (not installed, missing codec, etc). This would basically have librosa doing audioread’s job (multiplexing over decoding backends), but this is only a temporary situation until mp3 support arrives. In the meantime, we’d get faster loading and a more stable backend.

What do folks think?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
faroitcommented, Mar 11, 2019

We already have some docs on how to do this with sf: https://librosa.github.io/librosa/ioformats.html

yes, sure, I knew about this. What I meant is exactly how you implemented it in #847: rely on soundfile when it comes to seeking, thus avoid the outer loop. 👍

1reaction
faroitcommented, Mar 11, 2019

Another thing: since soundfile is in as a dependency, we could replace scipy.io.wavfile in the write_wav function (or make it a soft dependency as well). I could do a PR once the load/read is finished.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Read audio file - MATLAB audioread
This MATLAB function reads data from the file named filename, and returns sampled data, y, and a sample rate for that data, Fs....
Read more >
Advanced I/O Use Cases — librosa 0.9.1 documentation
librosa uses soundfile and audioread for reading audio. As of v0.7, librosa uses soundfile by default, and falls back on audioread only when...
Read more >
librosa.core.load() のバックエンドが audioread から ...
Explain your changes. This PR makes soundfile the primary IO backend, but will fall back to audioread on failure (eg if trying to...
Read more >
PBXware 6 Business - Settings
NOTE: In case users utilize SIP proxy for registration to PBXware, ... If set to 'Yes', recordings on emergency calls will be silent...
Read more >
NEWT-IPX User Guide
for the extraction of natural resources, Ross Video encourages you to use the appropriate take-back systems. These systems will reuse or recycle most...
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