Closed balintlaczko closed 3 years ago
It seems to be some kind of conflict between librosa and matplotlib. (More details soon.)
Minimal code to reproduce:
import matplotlib.pyplot as plt
import librosa
y, sr = librosa.load('dance.avi', sr=None)
print('Loaded file.')
fig, ax = plt.subplots(figsize=(12, 6), dpi=300)
print('Made plots.')
The progam will print 'Loaded file.' and then it halts forever (even KeyboardInterrupt won't work). If I am doing either the librosa.load
or the plt.subplots
everything is fine. If I do plt.subplots
and after that librosa.load
it will also work. But if I first load the file and then make the subplots (like above) I get into the deadlock.
Somewhat intuitively found a fix, which also seem to solve #190 at the same time. It is the opposite of clever, but it works. In audio.py after all imports:
plt.plot()
plt.close()
This somehow fixes everything. Tested in notebook/terminal on windows/ubuntu.
While investigating #190, found this. On Windows, everything works as expected - both in the notebook, and in the terminal (via IPython or script call), on Ubuntu everything works as expected in the notebook. However, in the Terminal (using IPython or via script call) any audio function will cause the Terminal to hang forever (without any CPU use) which is quite odd.