lib/google/cloud/speech/result.rb in google-cloud-speech-0.23.0 vs lib/google/cloud/speech/result.rb in google-cloud-speech-0.24.0

- old
+ new

@@ -11,23 +11,23 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -require "google/cloud/speech/v1beta1" +require "google/cloud/speech/v1" module Google module Cloud module Speech ## # # Result # # A speech recognition result corresponding to a portion of the audio. # - # See {Project#recognize} and {Job#results}. + # See {Project#recognize} and {Operation#results}. # - # @see https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#google.cloud.speech.v1beta1.SpeechRecognitionResult + # @see https://cloud.google.com/speech/reference/rpc/google.cloud.speech.V1#google.cloud.speech.V1.SpeechRecognitionResult # SpeechRecognitionResult # # @attr_reader [String] transcript Transcript text representing the words # that the user spoke. # @attr_reader [Float] confidence The confidence estimate between 0.0 and @@ -44,11 +44,13 @@ # require "google/cloud/speech" # # speech = Google::Cloud::Speech.new # # audio = speech.audio "path/to/audio.raw", - # encoding: :raw, sample_rate: 16000 + # encoding: :raw, + # language: "en-US", + # sample_rate: 16000 # results = audio.recognize # # result = results.first # result.transcript #=> "how old is the Brooklyn Bridge" # result.confidence #=> 0.9826789498329163 @@ -92,11 +94,13 @@ # require "google/cloud/speech" # # speech = Google::Cloud::Speech.new # # audio = speech.audio "path/to/audio.raw", - # encoding: :raw, sample_rate: 16000 + # encoding: :raw, + # language: "en-US", + # sample_rate: 16000 # results = audio.recognize # # result = results.first # result.transcript #=> "how old is the Brooklyn Bridge" # result.confidence #=> 0.9826789498329163 @@ -122,13 +126,13 @@ # A streaming speech recognition result corresponding to a portion of the # audio that is currently being processed. # # See {Project#stream} and {Stream#on_interim}. # - # @see https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#google.cloud.speech.v1beta1.SpeechRecognitionResult + # @see https://cloud.google.com/speech/reference/rpc/google.cloud.speech.V1#google.cloud.speech.V1.SpeechRecognitionResult # SpeechRecognitionResult - # @see https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#google.cloud.speech.v1beta1.StreamingRecognitionResult + # @see https://cloud.google.com/speech/reference/rpc/google.cloud.speech.V1#google.cloud.speech.V1.StreamingRecognitionResult # StreamingRecognitionResult # # @attr_reader [String] transcript Transcript text representing the words # that the user spoke. # @attr_reader [Float] confidence The confidence estimate between 0.0 and @@ -148,10 +152,12 @@ # @example # require "google/cloud/speech" # # speech = Google::Cloud::Speech.new # - # stream = speech.stream encoding: :raw, sample_rate: 16000 + # stream = speech.stream encoding: :raw, + # language: "en-US", + # sample_rate: 16000 # # # register callback for when an interim result is returned # stream.on_interim do |final_results, interim_results| # interim_result = interim_results.first # puts interim_result.transcript # "how old is the Brooklyn Bridge"