diff --git a/fastai2_audio/augment/signal.py b/fastai2_audio/augment/signal.py index 4adde80..4b2bc31 100644 --- a/fastai2_audio/augment/signal.py +++ b/fastai2_audio/augment/signal.py @@ -13,6 +13,9 @@ # Cell import colorednoise as cn +# Cell +#nbdev_comment _all_ = ["AudioPadType", "NoiseColor"] + # Cell mk_class('AudioPadType', **{o:o.lower() for o in ['Zeros', 'Zeros_After', 'Repeat']}, doc="All methods of padding audio as attributes to get tab-completion and typo-proofing") diff --git a/fastai2_audio/core/spectrogram.py b/fastai2_audio/core/spectrogram.py index ec0ecfd..fa257f4 100644 --- a/fastai2_audio/core/spectrogram.py +++ b/fastai2_audio/core/spectrogram.py @@ -46,6 +46,7 @@ def show_spectrogram(sg, ax, ctx, figsize, **kwargs): r, c = nchannels, sg.data.shape[0]//nchannels proper_kwargs = get_usable_kwargs(specshow, sg._settings, exclude=["ax", "kwargs", "data",]) if (r == 1 and c == 1): + if ax is None: _,ax = plt.subplots(1, 1, figsize=figsize) _show_spectrogram(sg, ax, proper_kwargs, **kwargs) plt.title("Channel 0 Image 0: {} X {}px".format(*sg.shape[-2:])) else: diff --git a/nbs/01_Core_Spectrogram.ipynb b/nbs/01_Core_Spectrogram.ipynb index 74a1c29..61f4e71 100644 --- a/nbs/01_Core_Spectrogram.ipynb +++ b/nbs/01_Core_Spectrogram.ipynb @@ -140,6 +140,7 @@ " r, c = nchannels, sg.data.shape[0]//nchannels\n", " proper_kwargs = get_usable_kwargs(specshow, sg._settings, exclude=[\"ax\", \"kwargs\", \"data\",])\n", " if (r == 1 and c == 1):\n", + " if ax is None: _,ax = plt.subplots(1, 1, figsize=figsize)\n", " _show_spectrogram(sg, ax, proper_kwargs, **kwargs)\n", " plt.title(\"Channel 0 Image 0: {} X {}px\".format(*sg.shape[-2:]))\n", " else:\n",