【发布时间】:2020-04-07 19:23:35
【问题描述】:
希望你会做得很好。我是 python 新手。我正在尝试在 python3 版本中使用 audio.scikits 库。我在 2.7(with audio.scikits) 中有一个工作代码版本。当我使用 python3 版本运行时,我收到 Import Error: No Module Named 'Version' 错误。我知道python3不再支持audio.scikits(如果我没记错的话)。任何人都可以建议我替换 audio.scikits 的库,在那里我可以使用 audio.scikits 等所有功能或任何其他可能对我有帮助的解决方案。提前致谢。
2.7 版本代码:
from scikits.audiolab import Format, Sndfile
from scipy.signal import firwin, lfilter
array = np.array(all)
fmt = Format('flac', 'pcm16')
nchannels = 1
cd, FileNameTmp = mkstemp('TmpSpeechFile.wav')
# making the file .flac
afile = Sndfile(FileNameTmp, 'w', fmt, nchannels, RawRate)
#writing in the file
afile.write_frames(array)
SendSpeech(FileNameTmp)
要检查整个代码,请访问:Google Asterisk Reference Code(modifying based on this code)
我想用 python3 支持的库修改这段代码。在这里,我正在为 Asterisk-Microsoft-Speech To Text SDK 执行此操作。
【问题讨论】:
标签: python-3.x speech-to-text microsoft-cognitive scikits