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

Suppress : UserWarning: PySoundFile failed #10753

Closed
pn12 opened this issue Sep 11, 2020 · 2 comments
Closed

Suppress : UserWarning: PySoundFile failed #10753

pn12 opened this issue Sep 11, 2020 · 2 comments
Labels
question Just a question :)

Comments

@pn12
Copy link

pn12 commented Sep 11, 2020

Hi ,

I have been using ray for librosa audio files and am unable to supress the below userwarning.

(pid=132) /opt/conda/lib/python3.7/site-packages/librosa/core/audio.py:162: UserWarning: PySoundFile failed. Trying audioread instead.
(pid=132) warnings.warn("PySoundFile failed. Trying audioread instead.")

Can anybody suggest a method to supress warnings in ray?

Thanks

@pn12 pn12 added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Sep 11, 2020
@sumanthratna sumanthratna added question Just a question :) and removed bug Something that is supposed to be working; but isn't labels Sep 12, 2020
@sumanthratna
Copy link
Member

Can anybody suggest a method to supress warnings in ray?

the warning came from warnings.warn which means you can add the following before calling whatever function raises that warning:

import warnings
warnings.filterwarnings("ignore")

note that the following might be safer if you want to maintain warnings in other parts of your code:

with warnings.catch_warnings():
    warnings.simplefilter("ignore")

see librosa/librosa#1015

most importantly: make sure you're okay with using audioread.


by the way, I'm labeling this as a question and not a bug since you're asking a question. If you think that PySoundFile should be used and this behavior is a bug, please open another bug report. I hope this helped! closing; feel free to comment if you still have related questions

@sumanthratna sumanthratna removed the triage Needs triage (eg: priority, bug/not-bug, and owning component) label Sep 12, 2020
@iamk0
Copy link

iamk0 commented Nov 19, 2022

Guys, good evening!
I search a solution to my problem and I believe that what happens here it's a same/extension of the question of the colleague above. I run this code:

import librosa, librosa.display
audio = '00b16e02-a418-47da-8341-867981ca3255.wav'
a0, fs = librosa.load(audio, sr=None)

and recieve this message:
"
LibsndfileError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/librosa/core/audio.py in load(path, sr, mono, offset, duration, dtype, res_type)
148 try:
--> 149 with sf.SoundFile(path) as sf_desc:
150 sr_native = sf_desc.samplerate

LibsndfileError: Error opening '00b16e02-a418-47da-8341-867981ca3255.wav': System error.
"

Do you think If have a actualization or other way for this?

Since that, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Just a question :)
Projects
None yet
Development

No branches or pull requests

3 participants