2016-10-18 4 views
0

私はPythonで音声認識を使用するプロジェクトに取り組んでいて、いくつかのサンプルコードを見ていました。使用するAPIキーとその外観好き。PythonでSpeechRecognition(Google)で使用するAPIキー

def callback(recognizer, audio): 
# received audio data, now we'll recognize it using Google Speech Recognition 
try: 
    # for testing purposes, we're just using the default API key 
    # to use another API key, use `r.recognize_google(audio, key="GOOGLE_SPEECH_RECOGNITION_API_KEY")` 
    # instead of `r.recognize_google(audio)` 
    print(recognizer.recognize_google(audio)) <-- right there 
except sr.UnknownValueError: 
    pass 
except sr.RequestError as e: 
    pass 

私はGoogle開発者アカウントを持っています。助けてください。ありがとう!

答えて

関連する問題