Skip to content

Instantly share code, notes, and snippets.

@dmastropole
dmastropole / hanning_window.py
Created October 14, 2019 21:45
Hanning Window
import numpy as np
window = np.hanning(25)
plt.plot(window)
plt.title('Hanning Window')
plt.xlabel('Time (ms)')
@dmastropole
dmastropole / plot_audio.py
Last active October 14, 2019 20:22
Plot Audio
# Plot the first second of audio
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
plt.plot(sec_audio)
plt.title('Sound Wave')
plt.xlabel('Samples')
plt.ylabel('Amplitude')
@dmastropole
dmastropole / extract_audio.py
Last active October 14, 2019 19:54
Extract Audio
# Extract the first second of audio
import essentia
import essentia.standard
loader = essentia.standard.MonoLoader(filename='example.wav', sampleRate=44100)
audio = loader()
sec_audio = audio[0:44100]