perl - Google app engine receiving audio binary stream -



perl - Google app engine receiving audio binary stream -

update after answer: code fixed , works below right code

im trying post perl script (on server) google app engine, , im not sure how go doing on google app engine side.

this perl script testing :

my $audio = `cat audiotest.flac`; $url = "http://app.appspot.com/mainpage" #this not real url $ua = lwp::useragent->new; $response = $ua->post($url, content_type => "audio/x-flac; rate=16000", content => $audio); if ($response->is_success) { print $response->content; }

so how send flac binary stream, question how google app engine receive , it. im attempting in python (but code not right , / or doesnt create sense)

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)

result supposed homecoming me string representation of flac sound submitted google's speech text service (also known x-webkit-speech). thought supposed set in payload urlfetch, , how result back? thanks!

since you're sending sound file body of request, not part of form, can access self.request.body.

i'm little confused why you're sending sound file app engine can send service, though.

perl google-app-engine

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -