def pcm_channels(wave_file):
    """Given a file-like object or file path representing a wave file,
    decompose it into its constituent PCM data streams.
    Input: A file like object or file path
    Output: A list of lists of integers representing the PCM coded data stream channels
        and the sample rate of the channels (mixed rate channels not supported)
    """
stream = wave.open(wave_file, 'rb')
num_channels = stream.getnchannels()
sample_rate = stream.getframerate()
sample_width = stream.getsampwidth()
num_frames = stream.getnframes()
raw_data = stream.readframes(num_frames)
stream.close()
total_samples = num_frames * num_channels
if sample_width == 1:
    fmt = '%iB' % total_samples
elif sample_width == 2:
    fmt = '%ih' % total_samples
else:
    raise ValueError('Only supports 8 and 16 bit audio formats.')
integer_data = struct.unpack(fmt, raw_data)
del raw_data
channels = [[] for time in range(num_channels)]
for index, value in enumerate(integer_data):
    bucket = index % num_channels
channels[bucket].append(value)
return channels, sample_rate
Интерпретация данных WAV