Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does iOS provide built in text to speech support or any class like NSSpeechRecognizer?

i have found many libraries like flite which can be be used, as in given here, but I want to know if there is any Built-In class provided by iOS SDK similar to NSSpeechRecognizer provided in OS X.

like image 944
Krishna Avatar asked Jul 04 '13 05:07

Krishna


People also ask

Does iPhone have speech to text?

With Dictation on iPhone, you can dictate text anywhere you can type it. You can also use typing and Dictation together—the keyboard stays open during Dictation so you can easily switch between voice and touch to enter text. For example, you can select text with touch and replace it with your voice.

How do you use text to speech on iPhone?

Hear selected text: Select the text, then tap Speak. Hear the entire screen: Swipe down with two fingers from the top of the screen. Use the controls that appear to pause speaking or adjust the rate.

What is Speech Recognition on Apple?

The speech recognition process involves capturing audio of the user's voice and sending that data to Apple's servers for processing. The audio you capture constitutes sensitive user data, and you must make every effort to protect it.

Why is my talk to text not working on my iPhone?

To make Voice-to-Text work, open the Settings app and go to Screen Time > Content & Privacy Restrictions > Allowed Apps. On the Allowed Apps screen, check if the Siri & Dictation toggle is disabled. If yes, turn on the Siri & Dictation toggle to re-enable Voice-to-Text on your iPhone.


1 Answers

There is no built in text-to-speech support in iOS 5 or 6 - you'll need to use a third party library. If you are using iOS 7 you're in luck.

There's a new class in iOS 7 called AVSpeechSynthesizer (Apple's docs can be found here). You can use this to perform text-to-speech. Here's a simple example:

AVSpeechUtterance *utterance = [AVSpeechUtterance 
                                speechUtteranceWithString:@"Hello world"];
AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];

[synth speakUtterance:utterance];

Properties such as speed and voice type are set in the AVSpeechUtterance, rather than the synthesizer.

like image 84
lxt Avatar answered Sep 21 '22 17:09

lxt