Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix .m4a support in some setups (possibly for other formats not supported by libsndfile) #1427

Merged
merged 4 commits into from
Dec 5, 2024

Conversation

racoiaws
Copy link
Contributor

@racoiaws racoiaws commented Nov 28, 2024

Requesting to merge following changes

  • Explicitly set m4a as unsupported in lhotse.audio.backend.LibsndfileBackend because it does not support m4a and will not support it in observable future. This is mostly a cosmetic change to eliminate a confusing exception when working with m4a files.

  • Set AudioreadBackend.supports_info to True because it has an info method just a line below. This is a bugfix making fallback to this backend actually work.

Real world impact: fixing Recording.from_file for m4a files in environments where torchaudio is not installed.
An example of such environment would be the nvcr.io/nvidia/nemo:24.07 container.

@racoiaws
Copy link
Contributor Author

racoiaws commented Dec 2, 2024

Also a little string formatting fix

@anteju anteju requested review from pzelasko and anteju December 2, 2024 16:46
Copy link
Collaborator

@pzelasko pzelasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@pzelasko
Copy link
Collaborator

pzelasko commented Dec 5, 2024

Don't worry about 3.10 and 3.11 tests - they are suffering from some GH action cache issue. If the other tests pass, we can merge it.

@pzelasko pzelasko merged commit 417e3c6 into lhotse-speech:master Dec 5, 2024
7 of 9 checks passed
yfyeung pushed a commit to yfyeung/lhotse that referenced this pull request Jan 8, 2025
…rted by libsndfile) (lhotse-speech#1427)

* LibsndfileBackend: Exclude mp4/m4a/m4b files from set of files it is applicable to

* AudioreadBackend: supports_info=True

* shar export: fix exception printing

* AudioreadBackend: black formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants