from scipy.io.wavfile import read
filepath = glob.glob('*.wav')
rates = []
datas = []
for fp in filepath:rate, data = read(fp)rates.append(rate)datas.append(data)
I get a list 'datas' which is :
[array([0, 0, 0, ..., 0, 0, 0], dtype=int16), array([0, 0, 0, ..., 0, 0, 1], dtype=int16), array([0, 0, 0, ..., 0, 0, 0], dtype=int16),..., array([0, 0, 0, ..., 0, 0, 0], dtype=int16)]
and I use
new_array = numpy.vstack([datas])
to get the new_array :
[[array([0, 0, 0, ..., 0, 0, 0], dtype=int16)array([0, 0, 0, ..., 0, 0, 1], dtype=int16)array([0, 0, 0, ..., 0, 0, 0], dtype=int16)...array([0, 0, 0, ..., 0, 0, 0], dtype=int16)]]
But I really prefer one is :
(array([[ 0, 0, 0, ..., 0, 0, 0],[ 0, 0, 0, ..., 0, 0, 1],[ 0, 0, 0, ..., 0, 0, 0],..., [ 0, 0, 0, ..., 0, 0, 0]], dtype=int16)
Which function should I use?
Thanks.