Search This Blog

Friday, November 19, 2010

iOS SDK Text To Speech in one line

Peace be upon you

How are you guys? I am so glade that I am writing to you, todays post will be short and hopefully useful.

While I was digging in iOS's private frameworks one library caught my attention, "VoiceServices" after some playing around it I found that there is away to use the "VoiceOver" capabilities out of its context, Here is video explaining the whole thing.


Here is the code for it.

[[[NSClassFromString(@"VSSpeechSynthesizer") new]autorelease] startSpeakingString:@"I like to speak everywhere"];


As you can see, with this line u can make the iOS speak whatever to you, just find useful use for it, something to read the twits or RSS feeds.


Enjoy :)


BR

Ahmed Essam

6 comments:

Ed Murphy said...

Thanks Ahmed, that was exactly what I was looking for.

Ed Murphy said...

Thanks Ahmed, that is exactly what I was looking for.

Unknown said...

Fabulous but you can't use it to publish an app on appStore because you use a private API, no ?

MNassar said...

I tried it and it didnt work. Neither on the simulator nor on the device. Am I missing something?!

Lando said...

Add VoiceServices Framework in your project:

Depending on where you install the IPhone SDK, the location of the VoiceServices framework may varies. Usually the VoiceServices framework is in the following directory:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk
/System/Library/PrivateFrameworks/VoiceServices.framework/VoiceServices

Note: The VoiceServies framework only available in the iPhoneOS platform, hence it can only build and run on the actual iPhone device. It can not be run and test on the simulator.

Lando said...

Add VoiceServices Framework in your project:

Depending on where you install the IPhone SDK, the location of the VoiceServices framework may varies. Usually the VoiceServices framework is in the following directory:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk
/System/Library/PrivateFrameworks/VoiceServices.framework/VoiceServices

Note: The VoiceServies framework only available in the iPhoneOS platform, hence it can only build and run on the actual iPhone device. It can not be run and test on the simulator.