[問題] google 語音辨識 url問題 當音檔超過1分消失
最近在嘗試語音辨識
我使用google 的辨識SpeechRecognition
其中的函數為r.recognize_google
網路上看到人討論當檔案超過一分鐘左右無法辨識
我上他的網站看到
https://cloud.google.com/speech/quotas
可以使用cloud 的uri
因此我嘗試將檔案上傳到google cloud platform
根據uri的概念的uri 為下
gs://speechrecognition21/test.wav
我的code如以下
import speech_recognition as sr
# obtain path to "english.wav" in the same folder as this script
AUDIO_FILE = "gs://speechrecognition21/test.wav"
# use the audio file as the audio source
r = sr.Recognizer()
with sr.AudioFile(AUDIO_FILE) as source:
audio = r.record(source) # read the entire audio file
r.recognize_google(audio, language='en-US')
想請問是否有人可以教導 是我那邊有錯誤?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.211.164
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1509711514.A.7F2.html
※ 編輯: wanson (140.112.211.164), 11/03/2017 20:34:19
推
11/04 01:09, , 1F
11/04 01:09, 1F
推
11/04 01:14, , 2F
11/04 01:14, 2F
推
11/04 17:39, , 3F
11/04 17:39, 3F
→
11/05 00:12, , 4F
11/05 00:12, 4F
→
11/05 00:13, , 5F
11/05 00:13, 5F