Search code examples
swiftgoogle-speech-api

Google speech API immediate timeout


I am building a swift app that uses the google speech api. Google speech was working an hour ago, but when I tried to run it again, the API immediately times out regardless of what timeout is set to. I have currently set the timeout to be 60 seconds however times out immediately. The error i get is:

GSpeechApiGRPC: Streaming audio data completion: (null), error: Error Domain=io.grpc Code=12 "GRPC target method can't be resolved." UserInfo={io.grpc.HeadersKey={
"alt-svc" = "hq=\":443\"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=\":443\"; ma=2592000; v=\"41,39,38,37,35\"";
date = "Thu, 21 Dec 2017 21:49:35 GMT";
}, NSLocalizedDescription=GRPC target method can't be resolved., io.grpc.TrailersKey={
}}, done: 1
2017-12-21 21:49:35.087286+0000[5499:174593] GSpeechApiGRPC: Recognize failed: Error Domain=io.grpc Code=12 "GRPC target method can't be resolved." UserInfo={io.grpc.HeadersKey={
"alt-svc" = "hq=\":443\"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=\":443\"; ma=2592000; v=\"41,39,38,37,35\"";
date = "Thu, 21 Dec 2017 21:49:35 GMT";
}, NSLocalizedDescription=GRPC target method can't be resolved., 
io.grpc.TrailersKey={
}}

I am using COCOAPODS. In the podfile, I am using "pod 'googleapis', :path => '.'" In the pod file, looks like it fetched v1beta1 but same podfile in the google example fetched v1, this might be an issue


Solution

  • Yes - the v1beta1 endpoint for the Cloud Speech API has been deprecated since April, and is being turned down. You should migrate your code to using the stable v1 endpoint. It sounds like there's a pod you can switch to to do that? It shouldn't be too bad a transition - mostly you should just see a couple renames, and those should be stable now that it's out of beta.