speech-to-text-websockets-ruby
speech-to-text-websockets-ruby copied to clipboard
[Speech to Text] The model parameter for websocket doesn't take effect.
Hi,
I specified the language model for transcription in params as follows, and prepared a wav file according to the model format.
params = {
'action' => "start",
'model' => 'ja-JP_BroadbandModel',
'content-type' => "audio/wav",
'continuous' => true,
'inactivity_timeout' => -1,
'interim_results' => true
}
However, Speech to Text tries to recognize the uploaded file as the default language model of en-US_BroadbandModel.
Deconstruct the issue, I used the same parameter in Node.js SDK. Speech to Text returned the transcription as desired. https://github.com/watson-developer-cloud/node-sdk
Could you think of anything that might have caused it?
You are specifying a parameter that is not supported by this sample.
If you look at the line https://github.com/watson-developer-cloud/speech-to-text-websockets-ruby/blob/master/example.rb#L36 you will see that model is not being used in the url to /recognize.
The model needs to be added to the query string
watson_url = "wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize?
watson-token=#{token.body}&model=ja-JP_BroadbandModel"
I see. Thanks!