12345678910 |
- import scipy.io.wavfile
- def wavfile_read_mono(path):
- # https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.wavfile.read.html
- rate, data = scipy.io.wavfile.read(path)
- data_first_channel = data[:, 0]
- for channel_index in range(1, data.shape[1]):
- assert (data_first_channel == data[:, channel_index]).all()
- return rate, data_first_channel
|