Skip to content

Commit c2c8adc

Browse files
committed
only set matplotlib.interactive(False) if WavReader class was initialized
1 parent 843e143 commit c2c8adc

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

mltu/preprocessors.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,20 @@ class WavReader:
5555
frame_step (int): Step size between frames in samples.
5656
fft_length (int): Number of FFT components.
5757
"""
58+
5859
def __init__(
59-
self,
60-
frame_length: int = 256,
61-
frame_step: int = 160,
62-
fft_length: int = 384,
63-
*args, **kwargs
64-
) -> None:
60+
self,
61+
frame_length: int = 256,
62+
frame_step: int = 160,
63+
fft_length: int = 384,
64+
*args, **kwargs
65+
) -> None:
6566
self.frame_length = frame_length
6667
self.frame_step = frame_step
6768
self.fft_length = fft_length
6869

70+
matplotlib.interactive(False)
71+
6972
@staticmethod
7073
def get_spectrogram(wav_path: str, frame_length: int, frame_step: int, fft_length: int) -> np.ndarray:
7174
"""Compute the spectrogram of a WAV file

0 commit comments

Comments
 (0)