How does tf.audio.decode_wav get its contents?

前端 未结 1 538
心在旅途
心在旅途 2021-01-18 18:22

I\'m trying to pull some audio files into Tensorflow by using tf.audio.decode_wav.

I can see someone is looking into providing more info in the docs, bu

1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-18 18:46

    You're right, tf.audio.decode_wav() requires a tensor. You can provide one with tf.io.read_file() which reads wav file into tensor of type string.

    raw_audio = tf.io.read_file(filename)
    waveform = tf.audio.decode_wav(raw_audio)
    

    0 讨论(0)
提交回复
热议问题