- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 pocketsphinx 将音频转换为文本。它工作正常。现在我想获取每个单词的时间戳。这是我的代码:
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秒。
这是已知问题还是我遗漏了什么?
最佳答案
我在某处读到比率是 1/100
因此,在我的项目中,我不小心将 1/10
而不是 1/100
但结果实际上对我所做的来说还不错。我建议除以 0.1
或 0.01
,看看能为您提供什么。
因此对于您的代码,只需尝试这些变量:
framerate = .1
或
framerate = .01
关于python - pocketsphinx python 给出错误的时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43634243/
给定一个带有多个 date_time 戳的字符串,我想 提取第一个戳及其前面的文本 候选字符串可以有一个或多个时间戳 后续的 date_time 戳记将被 sep="-" 隔开 后续date_time
是否可以合并从相机拍摄的文本和照片?我想在照片上标记日期和时间,但我在 Google 上找不到任何内容。 最佳答案 使用下面的代码来实现你所需要的。 Bitmap src = Bitm
有没有办法通过 Graph API 戳另一个用户?基于this post ,并使用 Graph Explorer ,我发布到“/USERID/pokes”,我已经授予它(Graph API 应用程序和
我有两个向左浮动的元素。一个是 body 的第一个 child ,另一个是容器的第一个 child ,容器是 body 的第二个 child 。 ...
我是一名优秀的程序员,十分优秀!