def decode_wav(wav):
    audio_bytes = tf.read_file(wav)
    waveform, _ = tf.audio.decode_wav(audio_bytes,
                                      desired_samples=max_utt_length)
    waveform = tf.transpose(waveform)
    num_read_mics = tf.shape(waveform)[0]
    waveform = tf.cond(num_read_mics >= num_mics,
                       lambda: waveform[:num_mics, :],
                       lambda: _pad_mics_tf(waveform, num_mics - num_read_mics))
    waveform = tf.reshape(waveform, (num_mics, max_utt_length))
    return waveform