rowntreerob

google speech api v1beta1 REST sample

Oct 5th, 2016
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. host a flac file on google cloud bucket then ref to it in cli command to recognize speech
  2.  
  3. curl -v -X POST -H "Content-Type: application/json" -d '{"config": {"encoding": "FLAC", "languageCode": "en-GB", "sampleRate": 22050}, "audio": {"uri": "gs://com-borneo-speech-test-2/voic_smpl.flac"}}' "https://speech.googleapis.com/v1beta1/speech:syncrecognize?key=AIzapJNHs"
  4.  
  5.  
  6. Note: Unnecessary use of -X or --request, POST is already inferred.
  7. * Trying 216.58.195.74...
  8. * Connected to speech.googleapis.com (216.58.195.74) port 443 (#0)
  9. * found 173 certificates in /etc/ssl/certs/ca-certificates.crt
  10. * found 697 certificates in /etc/ssl/certs
  11. * ALPN, offering http/1.1
  12. * SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
  13. * server certificate verification OK
  14. * server certificate status verification SKIPPED
  15. * common name: *.googleapis.com (matched)
  16. * server certificate expiration date OK
  17. * server certificate activation date OK
  18. * certificate public key: RSA
  19. * certificate version: #3
  20. * subject: C=US,ST=California,L=Mountain View,O=Google Inc,CN=*.googleapis.com
  21. * start date: Thu, 29 Sep 2016 17:13:20 GMT
  22. * expire date: Thu, 22 Dec 2016 16:37:00 GMT
  23. * issuer: C=US,O=Google Inc,CN=Google Internet Authority G2
  24. * compression: NULL
  25. * ALPN, server accepted to use http/1.1
  26. > POST /v1beta1/speech:syncrecognize?key=ApJNHs HTTP/1.1
  27. > Host: speech.googleapis.com
  28. > User-Agent: curl/7.47.0
  29. > Accept: */*
  30. > Content-Type: application/json
  31. > Content-Length: 144
  32. >
  33. * upload completely sent off: 144 out of 144 bytes
  34. < HTTP/1.1 200 OK
  35. < Content-Type: application/json; charset=UTF-8
  36. < Vary: X-Origin
  37. < Vary: Referer
  38. < Date: Wed, 05 Oct 2016 23:58:05 GMT
  39. < Server: ESF
  40. < Cache-Control: private
  41. < X-XSS-Protection: 1; mode=block
  42. < X-Frame-Options: SAMEORIGIN
  43. < X-Content-Type-Options: nosniff
  44. < Alt-Svc: quic=":443"; ma=2592000; v="36,35,34,33,32"
  45. < Accept-Ranges: none
  46. < Vary: Origin,Accept-Encoding
  47. < Transfer-Encoding: chunked
  48. <
  49. {
  50. "results": [
  51. {
  52. "alternatives": [
  53. {
  54. "transcript": "my aunt Ruth just had her 94th birthday and a lot of her relatives and my cousins gathered for a birthday party",
  55. "confidence": 0.92681831
  56. }
  57. ]
  58. }
  59. ]
  60. }
Add Comment
Please, Sign In to add comment