iOS 10 Speech to text Framework integration : How to know user stop talking

455 Views Asked by At

We are following blog present on below URL to integrate Speech Kit framework in our application

https://www.appcoda.com/siri-speech-framework/

This sample is working fine.

But can anyone know How to detect user has stop talking?. As the audio session is stop after 1 min. But we want to detect if user has completed talking so that we can identify any specific word user has said. And after completion of this we can again start the audio session.

Thanks in Advance!!!!

1

There are 1 best solutions below

0
On

There is no option in Speech framework by which you can detect user has stop talking. But there is a way around. You have to detect ambient sound level in decibel. Also you have to run a timer. Now after certain time say ~5 seconds if you are not receiving any sound or the decibel level becomes very low, you have to stop the microphone. Please note that the decibel level will never become ZERO as there is always some noise in our surroundings. So you have to calculate the level.

Here is the link where you can calculate the sound level in decibel - http://www.b2cloud.com.au/tutorial/obtaining-decibels-from-the-ios-microphone/