LA_
LA_

Reputation: 20429

How to create voice recognition on gae site?

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, headers={'Content-Type': 'audio/x-flac; rate=16000'})  
    self.response.out.write(result.content)

Upvotes: 0

Views: 331

Answers (1)

Peter Knego
Peter Knego

Reputation: 80340

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.

Upvotes: 2

Related Questions