audio - Reading *.wav files in Python -
i need analyze sound written in .wav file. need transform file set of numbers (arrays, example). think need use wave package. however, not know how works. example did following:
import wave w = wave.open('/usr/share/sounds/ekiga/voicemail.wav', 'r') in range(w.getnframes()): frame = w.readframes(i) print frame
as result of code expected see sound pressure function of time. in contrast see lot of strange, mysterious symbols (which not hexadecimal numbers). can anybody, pleas, me that?
per the sources, scipy.io.wavfile.read(somefile)
returns tuple of 2 items: first sampling rate in samples per second, second numpy
array data read file. looks pretty easy use!
Comments
Post a Comment