Dies ist das Stück Code, das ich laufen:tf.contrib.signal.stft eine leere Matrix zurück
import tensorflow as tf
sess = tf.InteractiveSession()
filename = 'song.mp3' # 30 second mp3 file
SAMPLES_PER_SEC = 44100
audio_binary = tf.read_file(filename)
pcm = tf.contrib.ffmpeg.decode_audio(audio_binary, file_format='mp3', samples_per_second=SAMPLES_PER_SEC, channel_count = 1)
stft = tf.contrib.signal.stft(pcm, frame_length=1024, frame_step=512, fft_length=1024)
sess.close()
Die MP3-Datei, weil print(pcm.eval().shape)
Rückkehr richtig decodiert wird:
(1323119, 1)
Und es gibt sogar einige tatsächliche nicht-Null-Werte, wenn ich sie mit print(pcm.eval()[1000:1010])
drucken:
[[ 0.18793298]
[ 0.16214484]
[ 0.16022217]
[ 0.15918455]
[ 0.16428113]
[ 0.19858395]
[ 0.22861415]
[ 0.2347789 ]
[ 0.22684409]
[ 0.20728172]]
Aber für einige reas auf print(stft.eval().shape)
zu auswertet:
(1323119, 0, 513) # why the zero dimension?
Und deshalb ist print(stft.eval())
:
[]
die zweite Dimension der tf.contrib.signal.stft
Ausgabe auf die Anzahl von Rahmen gemäß this gleich ist. Warum gibt es keine Frames?