I'm trying to read an audio file, and then process it and get its energy, frequency .... But when I read it, I know how to translate it into the format in which it is found.
import numpy as np
import wave
import matplotlib.pyplot as plt
import scipy.integrate as integrate
wav_file = wave.open('Alarm01.wav', 'r')
nchannels,sampwidth,framerate,nframes,comptype,compname = wav_file.getparams()
data = wav_file.readframes(nframes)
wav_file.close()
data
Out[100]: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\............