I want to get voice recorded during speech recognition. Based on confidence of recognized speech, the program will save or deny user's speech.
To do above I have two choices:
Record user's voice from browser and send to Node JS server. Then post voice to Google Speech API and get result. Based on confidence level do action.
Recognize and record user speech at browser. If recognition confidence level is good, then send voice to Node JS server to save it.
Second way seems to be good, but how can I get audio of user's speech?
Note: Speech will be continuous and every part of text will last about one minute.
Environment: Google Chrome v49, HTML5 (at browser side). Node JS (at server side)
Thanks for your help.
Edit #1 (Based on @raju's comment):
I have tried following code
var recognition = new webkitSpeechRecognition();
recognition.continuous = true;
recognition.interimResults = true;
recognition.lang = "tr-TR";
recognition.onresult = function(event) {
console.log(event)
}
recognition.start();
It works, but it only returns results of speech recognition. I want the raw sound data too. I looked up for different events and their parameters of "recognition" object, but none of them meets my needs. Is there any suggestions?