Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: API continuous Speech-To-Text -UPDATEDby zentara (Archbishop) |
on Sep 01, 2018 at 18:27 UTC ( [id://1221548]=note: print w/replies, xml ) | Need Help?? |
Unfortunately there is no ready-to-use API in Perl No lie there. There isn't even a Perl module for the alsalib. Just as some brainstorming, on linux anyways, you can easily access the microphone. Assuming you have the PulseAudio pavucontrol settings set correctly, you can get the microphone's audio with This will pipe whatever is coming in on the microphone, or line in ( must be set properly in alsamixer and pavucontrol ), to the default sound output. So you probably can capture the microphone and pipe it to a streaming application like Gstreamer. You would then need to have gstreamer send it to the server, and somehow get the text back. I noticed the services seem to offer a choice between streaming the audio or uploading a file. A file upload would be alot easier. Check out this old app I uploaded way back when. ztk-v4l-video-bloger/recorder. It shows basically how to access the alsa settings, turn on/off the microphone, and record. It may not work with your current hardware, but it contains some clues which may get you pointed in the right direction. To be honest, you might be best served by using an HTML5 Canvas app, written in javascript. It will handle the microphone, the upload and the text display. UPDATE: Also, check out this: speech recognition for linux. There is an interesting link concerning using Gstreamer Gstreamer and speech recognition, it may just give you the solution. I'm not really a human, but I play one on earth. ..... an animated JAPH
In Section
Seekers of Perl Wisdom
|
|