Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to load wav file python

import matplotlib.pyplot as plt
from scipy import signal
from scipy.io import wavfile

sample_rate, samples = wavfile.read('path-to-mono-audio-file.wav')
frequencies, times, spectrogram = signal.spectrogram(samples, sample_rate)

plt.pcolormesh(times, frequencies, spectrogram)
plt.imshow(spectrogram)
plt.ylabel('Frequency [Hz]')
plt.xlabel('Time [sec]')
plt.show()
Comment

how to load wav file with python

from scipy.io import wavfile
samplerate, data = wavfile.read('./output/audio.wav')

# method 2
import librosa
#Store the sampling rate as `sr`
y, sr = librosa.load(filename)
Comment

PREVIOUS NEXT
Code Example
Python :: convert excel to csv using python 
Python :: python read text file look for string 
Python :: python auto updating clock 
Python :: Python pandas drop any row 
Python :: jupyter notebook change default directory 
Python :: python to golang 
Python :: python check folder exist 
Python :: remove last element from dictionary python 
Python :: python backward difference 
Python :: python find location of module 
Python :: tkinter refresh window 
Python :: python link to jpg 
Python :: createview django 
Python :: how to create a database in python 
Python :: indices of true boolean array pyton 
Python :: Get all columns with particular name in string 
Python :: python clear screen windows and linux 
Python :: language detection python 
Python :: opencv skip video frames 
Python :: python print int in string with zero padding 
Python :: how to plotting horizontal bar on matplotlib 
Python :: pandas replace space with underscore in column names 
Python :: handler.setLevel(logging.DEBUG) not working python 
Python :: python requests cookies 
Python :: pd merge on multiple columns 
Python :: python pip install 
Python :: numpy create a matrix of certain value 
Python :: get os information python 
Python :: logging in with selenium 
Python :: decrease hours in datetime python 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =