watson-developer-cloud / speech-to-text-websockets-python

Python client that interacts with the IBM Watson Speech To Text service through its WebSockets interface
http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/speech-to-text.html
86 stars 63 forks source link

extend this feature to general stt #22

Closed surajhes closed 5 years ago

surajhes commented 7 years ago

Hi i wanted to understand if this script can be used in a way where it listens to the speech from the microphone of the user and performs the transcribing of the spoken test?

daniel-bolanos commented 7 years ago

currently it does not have an option to take audio from the microphone, however adding support for that should be quite simple, just grab the samples and feed them to the service like maybeSendChunk does, you just need to know the recording format in case you need to change the content-type value . If you decide to do it we would be very happy to incorporate it via pull request.

aishaambar commented 6 years ago

Hi. @daniel-bolanos ! Can you clearly explain the necessary changes that I will have to make in this code,in order to take input from microphone instead of prerecorded audio files? Please help! Waiting for your helpful response

aishaambar commented 6 years ago

@surajhes ,were you able to modify this code to take input from microphone??

philippe-gregoire commented 6 years ago

Reading from microphone will require a Python abstraction library such as PyAudio. Or on Linux systems, you can use arecord's raw mode and pipe it to Watson STT through the websocket API.

GuiJordao21 commented 6 years ago

Was anyone able to do this?? I'm trying my best here, but it's a bit tricky.

aishaambar commented 6 years ago

I'm still working on it. After necessary modifications, script has some logical errors but it's working.

aishaambar commented 6 years ago

@philippe-gregoire yes I'm using PyAudio

GuiJordao21 commented 6 years ago

@aishaambar Can you share your code with us?