python compare()_Python Speech Compare

问题

I have two .wav files that I need to compare and decide if they contain the same words (same order too).

I have been searching for the best method for a while now. I can't figure out how to have pyspeech use a file as input. I've tried getting the CMU sphinx project working but I cant seem to get GStreamer to work with Python 27 let alone their project. I've messed around with DragonFly as well with no luck.

I am using Win7 64bit with Python27. Does anyone have any ideas?

Any help is greatly appreciated.

回答1:

You could try PySpeech. For some more info see pyspeech (python) - Transcribe mp3 files?. I have never used this, but I believe it leverages the built in speech recognition engine of Windows. This will let you convert the Wav files to text and then you can do a text compare.

To use the Windows speech engine and use a wav file for input there are two requirements.

Use an inproc recognizer (SpeechRecognitionEngine). Shared recognizers cannot use Wav files as input.

On the recognizer object call SetInputToWaveFile to specify your input wav file.

You may have to resample the wav files because the speech recognition engines only support certain sample rates.

8 bits per sample

single channel mono

22,050 samples per second

PCM encoding

works well on Windows. See https://stackoverflow.com/a/6203533/90236 for some more info.

For some more background on the windows speech engines, you might take a look at SAPI and Windows 7 Problem and What is the difference between System.Speech.Recognition and Microsoft.Speech.Recognition?

来源:https://stackoverflow.com/questions/9404099/python-speech-compare

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值