Python Speech Compare
Asked Answered
S

1

6

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.

Scattering answered 22/2, 2012 at 22:24 Comment(0)
P
5

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.

  1. Use an inproc recognizer (SpeechRecognitionEngine). Shared recognizers cannot use Wav files as input.
  2. 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://mcmap.net/q/1330564/-help-with-sapi-v5-1-speechrecognitionengine-always-gives-same-wrong-result-with-c 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?

Pauiie answered 23/2, 2012 at 21:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.