Created
September 19, 2015 01:18
-
-
Save hackintoshrao/ec14c9d88147e62ff3ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.io.wavfile import read #import wav audio related functions | |
import matplotlib.pyplot as plt #for plotting | |
fs , x = read('/home/karthic/Downloads/kalimba.wav') #x is an array of integers containing all the samples of the wav file | |
print "sample rate = " ,fs #sample rate of the wav file | |
print "Total samples in the wav audio: ",x.size #total number of samples in the wav audio | |
print "Length of wav file in seconds: ",x.size/float(fs) | |
#number of samples / sampling rate gives the length of the wav file in seconds | |
plt.plot(x) #plot the wav sampling | |
plt.show() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment