High resolution compatible wav files that have increased suddenly recently. This is a 24-bit bit rate, which is very annoying to handle with python. The module that solves such a problem is "wavio".
pip install wavio
wavread.py
import wavio
wav = wavio.read(filename)
fs = wav.rate #Sampling frequency[Hz]
samplewidth = wav.sampwidth #Sample width[Byte]
bit = wav.sampwidth * 8 #Number of quantization bits[bit]
data = wav.data #Waveform data
ch = len(wav.data[0, :]) #Number of channels
wavwrite.py
wavio.write("filename.wav", data, fs, sampwidth = samplewidth)
What actually works behind the scenes is the standard python module wave, but well, it would be convenient to have something like this.
Recommended Posts