[英]Different spectrogram between audio_ops and tf.contrib.signal
[英]tf.contrib.ffmpeg.decode_audio replacement?
在 tensorflow 文档中,它指出 tf.contrib.ffmpeg.decode_audio 已贬值,但它没有说明它的替代品是什么......
此功能已弃用。 它将在 2018-09-04 之后移除。 更新说明:这将被删除,不应使用。
这是链接: https : //www.tensorflow.org/api_docs/python/tf/contrib/ffmpeg/decode_audio
尝试tensorflow.contrib.framework.python.ops.audio_ops.decode_wav
。
这可能在张量流2中消失了
您不必使用 TensorFlow 来解码音频文件。 您可以使用另一个 Python 库(尽管 GIL 可能会减慢您的速度)。
tensorflow-io库现在有AudioIOTensor
作为解码音频文件的接口,同时还可以跟踪它们的音频采样率。 您可以按如下方式使用它:
import tensorflow as tf
import tensorflow_io as tfio
audio_tensor = tfio.audio.AudioIOTensor("filename.flac")
print("Sample rate is", int(audio_tensor.rate))
# tensor = Decoded audio as a tf.Tensor of shape (frames, channels).
tensor = audio_tensor.to_tensor()
print(tensor.shape[0], "frames containing", tensor.shape[1], "channels")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.