You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure what the correct sending rate is given a sample size of 44100Hz with 16bit rate. I was informed to send 88200 bytes per second, and I also tried brute forcing different values. The error message doesn't help and additional information in the error message would be helpful. Such as, how to better calibrate the transmission rate given a sample rate and encoding. I want to note that I used the data in audio.grpc.content as the payload.
Any help would be appreciated! Thank you.
Error: 11:Audio data is being streamed too fast. Please stream audio data approximately at real time.
Code:
require 'google/cloud/speech'
# Stream to speech and wait for transcription...
speech = Google::Cloud::Speech.new
# Setup raw file to be sent in as an Asynchronous job maximum time is ~80mins
audio = speech.audio "prince.raw",
encoding: :raw, sample_rate: 44100,
language: :ja
# Send stream job
stream = speech.stream encoding: :raw, sample_rate: 44100, language: 'ja'
# Result callback
stream.on_result do |results|
result = results.first
puts result.transcript
end
# Error callback
stream.on_error do |error|
puts error
end
# Start callback
stream.on_speech_start do
puts "Started listening"
end
# Complete callback
stream.on_complete do
puts "Finished"
end
bytes_sent = 0
chunk_size = 88200
bytes_total = audio.grpc.content.size # Content of my raw file (This may be wrong)..
# Send one chunk per second
while bytes_sent < bytes_total do
stream.send audio.grpc.content[bytes_sent, (bytes_sent + chunk_size)]
bytes_sent += chunk_size
sleep 1
end
# Finished sending
stream.complete!
# Stop stream
stream.stop
The text was updated successfully, but these errors were encountered:
Context: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/v0.22.0/google/cloud/speech/project?method=stream-instance
I'm not sure what the correct sending rate is given a sample size of 44100Hz with 16bit rate. I was informed to send 88200 bytes per second, and I also tried brute forcing different values. The error message doesn't help and additional information in the error message would be helpful. Such as, how to better calibrate the transmission rate given a sample rate and encoding. I want to note that I used the data in
audio.grpc.content
as the payload.Any help would be appreciated! Thank you.
Error:
11:Audio data is being streamed too fast. Please stream audio data approximately at real time.
Code:
The text was updated successfully, but these errors were encountered: