Closed MarkusMcNugen closed 8 years ago
At the very least add the bandmodel variable to the function. I now see that IBMs Speech to Text API defaults to the Wideband model. So maybe that is the way to go, but using narrowband should still be supported to eliminate false HTTPError exceptions.
Automatic upsampling is done in the latest version, 3.2.0, which fixes the issue of not being able to use sample rates below 16kHz.
Add a model argument to def recognize_ibm() like in the code below to allow the selection of using Wideband or Narrowband model and use the Narrowband model by default. Note bandmodel and model variables.
I'm requesting this because while using speechrecognition I was getting an HTTPError exception telling me "request failed, ensure that username and password are correct"_ when I knew the username and password were correct. The actual cause was me using a narrowband wav while speech_recognition was trying to upload it as a wideband. According to IBMs documentation submitting a wideband audio source with the narrowband model should work fine, but not the other way around.
As per IBMs Speech to Text API documentation: "The service automatically adjusts the incoming sampling rate to match the model. In theory, therefore, you can send 44 KHz audio with the narrowband model. Note, however, that the service does not accept audio sampled at a lower rate than the intrinsic sample rate of the model."