开发者

How to create voice recognition on gae site?

开发者 https://www.devze.com 2023-04-11 10:07 出处:网络
Here is the code to recognize flac file. But how can I record that with user\'s browser? (my site is for android and iphone)

Here is the code to recognize flac file. But how can I record that with user's browser? (my site is for android and iphone)

class MainPage(webapp.RequestHandler):  
def post(self):
    destinationURL = "http://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=en-US"
    result = urlfetch.fetch(url=destinationURL, payload= self.request.body, method=urlfetch.POST, header开发者_C百科s={'Content-Type': 'audio/x-flac; rate=16000'})  
    self.response.out.write(result.content)


Browser-side voice recording can only be done with java applets, which neither iPhone nor Android supports.

There is a possibility to record voice with Flash and RTMP server, but Flash only runs on (some) Android phones and RTMP servers do not run on GAE (since they require sockets).

The only way to make this work is to forget the browser and create native apps that record audio and upload it to GAE server via HTTP.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号