1
我正在使用pocketsphinx将音频转换为文本。它工作正常。现在我想要得到每个单词的时间戳。这是我的代码:pocketsphinx python给出错误的时间戳
import speech_recognition as sr
r = sr.Recognizer()
framerate = 100
with sr.AudioFile("1.wav") as source:
audio = r.record(source)
decoder = r.recognize_sphinx(audio, show_all=False)
print ([(seg.word, seg.start_frame/framerate)for seg in decoder.seg()])
根据他们的文档,默认的帧率是100.我得到了每个单词的开始时间。但是,这是不正确的。差别是2秒,有时超过3秒。
这是已知的问题或我错过了什么?