语音识别是否与Google的付费API一样?

时间:2019-03-28 13:37:28

标签: python speech-recognition speech-to-text google-speech-api

我正在尝试使用语音识别库进行语音识别。但是我有一个疑问:从这个库中,我可以使用Google。但是Google提出了付费语音识别程序包。这怎么可能?

代码:

import speech_recognition as sr

def decodeSpeech(wavefile):
    r = sr.Recognizer()
    with sr.WavFile(wavefile) as source:
        audio = r.record(source)
        try:
            print('Transcription GOOGLE: ' + r.recognize_google(
           audio, language='fr-FR', show_all=False))
        except LookupError:
            print('Cannot understand audio!')

        try:
            print('Transcription SPHINX: ' + r.recognize_sphinx(
            audio, language='fr-FR', show_all=False))
        except sr.UnknownValueError:
            print('Sphinx could not understand audio')
        except sr.RequestError as e:
            print('Sphinx error: {0}'.format(str(e)))

WAVFILE = 'ma_maison_sylvie.wav'
decodeSpeech(WAVFILE)

r.recognize_google 行是否与Google付费API相同?是 Google语音识别还是 Google Cloud Speech API

0 个答案:

没有答案