speech-to-text-websockets-python icon indicating copy to clipboard operation
speech-to-text-websockets-python copied to clipboard

extend this feature to general stt

Open surajhes opened this issue 9 years ago • 8 comments

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?

surajhes avatar Jul 27 '17 21:07 surajhes

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.

daniel-bolanos avatar Jul 27 '17 22:07 daniel-bolanos

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 avatar Dec 15 '17 18:12 aishaambar

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

aishaambar avatar Dec 18 '17 04:12 aishaambar

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.

philippe-gregoire avatar Dec 18 '17 09:12 philippe-gregoire

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

GuiJordao21 avatar Jan 04 '18 10:01 GuiJordao21

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

aishaambar avatar Jan 05 '18 09:01 aishaambar

@philippe-gregoire yes I'm using PyAudio

aishaambar avatar Jan 05 '18 09:01 aishaambar

@aishaambar Can you share your code with us?

GuiJordao21 avatar Jan 05 '18 10:01 GuiJordao21