I am developing an app for ipad in which i want to add functionality as below:-
When user'll tap on play button Text to speech will start to play that Text at that time, that word will be highlighted as they are being read.
I know about in built feature of iOS but i want to do it programatically.
I searched a lot and got as below:
Link 1
Link 2
Link 3
If anyone know any API or any inbuilt framework. Let me know.
Appreciate your time.
You can make use of the brilliant text-to-speech library inbuilt with iOS 7 onwards called AVSpeechSynthesizer.
You can control the speech as well as get notifications of it's progress using the AVSpeechSynthesizer delegate methods. The method that should help you achieve your desired functionality should be the
speechSynthesizer:willSpeakRangeOfSpeechString:utterance:
method.
Have a look at the AVSpeechSynthesizer as well as the AVSpeechSynthesizerDelegate API reference.
This post by Matt Thompson on NSHipster features the exact same functionality with an example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With