diff --git a/plot_nodes.py b/plot_nodes.py index 4f933a6..03c6920 100644 --- a/plot_nodes.py +++ b/plot_nodes.py @@ -28,7 +28,7 @@ class PlotWaveform: FUNCTION = "plot" def plot(self, audio, title="Waveform"): - waveform = audio["waveform"].movedim(1, -1).numpy() + waveform = audio["waveform"].movedim(0, -1).numpy() num_channels, num_frames, _ = waveform.shape time_axis = torch.arange(0, num_frames) / audio["sample_rate"] figure, axes = plt.subplots(num_channels, 1) diff --git a/spect_nodes.py b/spect_nodes.py index 40eaf4f..141607d 100644 --- a/spect_nodes.py +++ b/spect_nodes.py @@ -23,7 +23,7 @@ class Spectrogram: hop_length=-1): if win_length == -1: win_length = None if hop_length == -1: hop_length = None - waveform = audio["waveform"].movedim(1, -1).squeeze() + waveform = audio["waveform"].movedim(0, -1).squeeze() spectrogram = T.Spectrogram(n_fft=n_fft, win_length=win_length, hop_length=hop_length, @@ -55,7 +55,7 @@ class PowerSpectrogram: hop_length=-1): if win_length == -1: win_length = None if hop_length == -1: hop_length = None - waveform = audio["waveform"].movedim(1, -1).squeeze() + waveform = audio["waveform"].movedim(0, -1).squeeze() spectrogram = T.Spectrogram(n_fft=n_fft, win_length=win_length, hop_length=hop_length, @@ -89,7 +89,7 @@ class MelSpectrogram: hop_length=-1): if win_length == -1: win_length = None if hop_length == -1: hop_length = None - waveform = audio["waveform"].movedim(1, -1).squeeze() + waveform = audio["waveform"].movedim(0, -1).squeeze() spectrogram = T.MelSpectrogram(sample_rate=audio["sample_rate"], n_fft=n_fft, n_mels=n_mels,