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 :: The Python path in your debug configuration is invalid. 
Python :: django media root 
Python :: python keyboardinterrupt 
Python :: pandas read dictionary 
Python :: difference between generator and iterator in python 
Python :: pandas groupby aggregate 
Python :: python check string not exist in array 
Python :: tkinter text blurry 
Python :: python os abspath 
Python :: python dictionary to array 
Python :: permutation with repetition python 
Python :: python program to convert unit 
Python :: how to get user id from username discord.py 
Python :: sort dict by values 
Python :: ip condition in tpl 
Python :: python tkinter getting labels 
Python :: rnadom number python 
Python :: delete n from textpython 
Python :: pandas dataframe to parquet s3 
Python :: Create list with numbers between 2 values by 
Python :: transpose matrix numpy 
Python :: exit in python 
Python :: python add up values in list 
Python :: numpy euclidean distance 
Python :: python insertion sort 
Python :: python allowed variable caracters 
Python :: Make a basic pygame window 
Python :: python color input 
Python :: how to install neat 
Python :: django app 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =