Skip to main content

Speech to Text Using IBM Watson from Command Line

This is more like a personal notes for my reference. If it assists anyone it is a bonus.

Assumed that 

  • You have created an account on blue-mix
  • You have obtained the user-id and password (I will call them your_userid, your_password)
  • You have a speech file called speech.wav 
  • You desire to obtain the transcript in the file transcribed_speech.txt
  • You have installed curl on your machine
  • You are not behind a proxy.com

Then from the command (long) line using curl 


curl -u your_userid:your_password -X POST --header "Content-Type: audio/wav" --header "Transfer-Encoding: chunked" --data-binary @speech.wav https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true > transcribed_speech.txt

should create  the best according to watson speech to text engine transcription of the audio speech.wav in the file transcribed_speech.txt

if you are behind a firewall with p_user as the user-id and p_passwd is the password. Then the following should do the job!


curl --proxy http://p_user:p_passwd@proxy.com:8080 -your_userid:your_password -X POST --header "Content-Type: audio/wav" --header "Transfer-Encoding: chunked" --data-binary @speech.wav https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true > transcribed_speech.txt

Happy speech to text-ing :-) 
Sample very rudimentary perl script

Also: See how to similarly use Google ASR 

Comments

Sujit Devkar said…
This comment has been removed by the author.

Popular posts from this blog

Visualizing Speech Processing Challenges!

Often it is difficult to emphasize the difficulty that one faces during speech signal processing. Thanks to the large population use of speech recognition in the form of Alexa, Google Home when most of us are asking for a very limited information ("call my mother", "play the top 50 international hits" or "switch off the lights") which is quite well captured by the speech recognition engine in the form of contextual knowledge (it knows where you are; it knows your calendar, it know you parents phone number, it knows your preference, it knows your facebook likes .... ). Same Same - Different Different:   You speak X = /My voice is my password/ and I speak Y= /My voice is my password/. In speech recognition both our speech samples (X and Y) need to be recognized as "My voice is my password" while in speaker biometric X has to be attributed to you and and Y has to be attributed to me! In this blog post we try to show   visually   what it means to pro...

BITS Pilani Goa Campus - Some Useful Information

You have cleared the BIT Aptitude Test and have got admission to BITS Pilani Goa Campus. Congratulation . Well Done. This is how the main building looks! Read on for some useful information, especially since you are traveling for the first time to the campus and more or less you will face the same scenario that we faced! We were asked report on 29-Jul-2018 (Sunday) to take admission on, 30-Jul-2018.  We reached Madgoan (we traveled by train though the airport is pretty close to the BITS campus, primarily to allow us to carry more luggage!)at around 0700 hours (expect a few drizzles to some good rain - so carry an umbrella) on 29-July-2019. As you come out you will be hounded by several taxi drivers, but the best is to take the official pre-paid taxi. It should cost you INR 700 to reach the BITS campus. We had booked a hotel in Vasco (this is one of the closest suburb from BITS campus, a taxi should charge you around 300-350 INR; you will make plenty of trips!) ...

Paying Property Taxes Online - Government of Andhra Pradesh

When my father received a SMS stating that you can pay your property tax online. I was thrilled. Why? My father stays with me in Mumbai and paying property tax for a small flat in   Proddatur Municipality was always a pain. The best was to request someone to pay it on behalf of him which meant it was at the time and convenience of the person we requested. Mind you this is no easy task, asking someone to pay on your behalf. A quick search on the web got me to  Commissioner & Director of Municipal Administration  and I it does have an online payment of taxes tab. And boy this was a breeze. As soon as you press the online payment tab you see a neat selection of District | Muncipality | Tax Type. For my purposes I choose Ysr Kadapa (it would be nice if they changed it to read "YSR Kadapa") and then "1014-Proddatur" for Municipality and I chose Tax Type is "Property Tax" (the other option is Water tax) Once you fill in these details. You are directe...