I am trying to divide the data I retrieve from a wav into 10ms segments for dynamic time warping.
import wave
import contextlib
data = np.zeros((1, 7000))
rate, wav_data = wavfile.read(file_path)
with contextlib.closing(wave.open(file_path, 'r')) as f:
frames = f.getnframes()
rate = f.getframerate()
duration = frames / float(rate)
Is there any existing library that do that
Thanks
If you're interested in post-processing the data, you'll probably be working with it as numpy data.
That's not an integer number, so unless you're going to interpolate your data, you'll need to pad your data with zeros to get nice 110 frames long samples (which are about 10ms at this framerate).
So now, every row of the
segments
array is about 10ms long.