0

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\............
cdarke
  • 42,728
  • 8
  • 80
  • 84
Benghy
  • 1
  • *"I know how to translate it "* - did you mean you *don't* know how to translate it? – cdarke Jun 10 '19 at 14:33
  • its just binary string you are reading, go to https://stackoverflow.com/questions/2060628/reading-wav-files-in-python to read more. – Jainil Patel Jun 10 '19 at 14:42

0 Answers0