File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,9 @@ class AudioReader:
5959 """
6060 try :
6161 import librosa
62- except ImportError :
63- raise ImportError ("librosa is required to read Audio. Please install it with `pip install librosa`." )
62+ librosa .__version__
63+ except AttributeError :
64+ raise ImportError ("librosa is required to read WAV files. Please install it with `pip install librosa`." )
6465
6566 def __init__ (
6667 self ,
@@ -104,10 +105,12 @@ class WavReader:
104105 frame_step (int): Step size between frames in samples.
105106 fft_length (int): Number of FFT components.
106107 """
108+ # Check if librosa is installed
107109 try :
108110 import librosa
109- except ImportError :
110- raise ImportError ("librosa is required to read Audio. Please install it with `pip install librosa`." )
111+ librosa .__version__
112+ except AttributeError :
113+ raise ImportError ("librosa is required to read WAV files. Please install it with `pip install librosa`." )
111114
112115 def __init__ (
113116 self ,
You can’t perform that action at this time.
0 commit comments