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 :: python join two lists as dictionary 
Python :: import fashion mnist keras 
Python :: python clock 
Python :: dataframe delete row 
Python :: sqlalchemy check if database exists 
Python :: how to display a manytomany field in django rest framework 
Python :: virtual environment flask 
Python :: creata daframe python 
Python :: python finite difference approximation backward difference 
Python :: how to slicing dataframe using two conditions 
Python :: pandas add rows from df to another 
Python :: python logging to file 
Python :: createview 
Python :: empty directory if not empty python 
Python :: does break stop all loops 
Python :: python ls directory 
Python :: How to get all links from a google search using python 
Python :: convert_text_to_hexadecimal_viva.py in python 
Python :: python module with alphabet list 
Python :: encode labels in scikit learn 
Python :: sql alchemy engine all tables 
Python :: print variable in string python 
Python :: python argparse include default information 
Python :: pandas group by count 
Python :: parse first characters from string python 
Python :: pip install python 
Python :: python program to count vowels in a string 
Python :: pandas apply with multiple arguments 
Python :: get date and time formatted python 
Python :: pyAudioAnalysis 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =