Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All 500's #3

Open
jpschewe opened this issue Apr 10, 2011 · 3 comments
Open

All 500's #3

jpschewe opened this issue Apr 10, 2011 · 3 comments

Comments

@jpschewe
Copy link

Everything I try and upload is returning a 500 error. Any suggestions? I tried changing the user-agent thinking that google might be checking.

flac 1.2.1, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007  Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

chunk-01-S-0.wav: WARNING: skipping unknown sub-chunk 'LIST' (use --keep-foreign-metadata to keep)
chunk-01-S-0.wav: wrote 671111 bytes, ratio=0.383
success?
sending chunk of size 19.86...
326384.00/326384.00
500 from google retry after 0.5 seconds
326384.00/326384.00
500 from google retry after 0.5 seconds
326384.00/326384.00
500 from google retry after 0.5 seconds
@jpschewe
Copy link
Author

Made some progress. I shrunk the chunk interval from 30 down to 3 and now I'm getting responses. However the json doesn't seem to match what you're expecting. It also seems that the output json file gets overwritten by each chunk instead of appended to.

@jpschewe
Copy link
Author

I've committed changes to my fork that return an array of JSON objects instead of a single JSON object to account for the chunking. I've also reduced the chunk interval down to 3 seconds. This seems to be working.

When I process a file I do this:
puts "Processing #{file}"
audio = Speech::AudioToText.new(file)
captured_json = audio.to_text
combined = ""
captured_json.each do|json|
hypotheses = json['hypotheses']
#puts "hypotheses: #{hypotheses.inspect}"
first_hypo = hypotheses.first
#puts "first_hypo: #{first_hypo.inspect}"
answer = first_hypo.first
#puts "answer: #{answer}"
combined << answer << " "
end

  puts "result: #{combined}"

@taf2
Copy link
Owner

taf2 commented Apr 13, 2011

This looks great! I'm going to cycle back to this later in the week. Hoping google chins in with some docs :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants