1

Is there any way to convert string (character) to Audio file in iOS? My question is I have a string and that string I want to convert into sound file, Is it possible without using any third party api?

Thanks in Advance.....

Ajay
  • 1,622
  • 20
  • 36
Renish Dadhaniya
  • 10,642
  • 2
  • 31
  • 56
  • 2
    possible duplicate of:http://stackoverflow.com/questions/416064/text-to-speech-on-iphone – Ajay Feb 07 '14 at 09:20
  • @Ajay.sorry for my incomplete question.my means without third party Api. – Renish Dadhaniya Feb 07 '14 at 09:32
  • @Ajay,i tried this ESpeakEngine & fliteEngine 1.4 third party Api.Is't Acceptable By Apple? and one more think it's using can i set like Sound Like Small girls or Boy (likes Kids Sound) ? – Renish Dadhaniya Feb 12 '14 at 13:10

3 Answers3

3

Yes, with iOS 7, The AVSpeechSynthesizer class produces synthesized speech from text on an iOS device, and provides methods for controlling or monitoring the progress of ongoing speech.

EDIT: Simply add AVFoundation framework in your project, Add the import statement #import <AVFoundation/AVFoundation.h> and execute this piece of code:

AVSpeechSynthesizer *speechSynthesizer = [[AVSpeechSynthesizer alloc]init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"Really, its very easy."];
[utterance setRate:0.5f];
[speechSynthesizer speakUtterance:utterance];
Ajay
  • 1,622
  • 20
  • 36
  • is it possible to use with cocos2d Game engine?In cocos2d 3.0 i play all file with OALSimpleAudio player. – Renish Dadhaniya Feb 07 '14 at 13:11
  • I really don't know about cocos2d and game development but I think you can use any of the iOS SDK methods while using cocos2D. Cocos2D builds on the official Apple SDK – it doesn’t preclude you using any of the Apple stuff. – Ajay Feb 07 '14 at 13:21
  • ,i tried this ESpeakEngine & fliteEngine 1.4 third party Api.Is't Acceptable By Apple? and one more think it's using can i set like Sound Like Small girls or Boy (likes Kids Sound). – Renish Dadhaniya Feb 12 '14 at 13:11
  • Using AVSpeechSynthesizer you can set male/female voice. It provides these much options [AVSpeechSynthesisVoice speechVoices]. and For kids sound you can try different voice,volume and pitch but I'm not sure. and I don't think Apple will denied using third party apis as long as they are as per their guidelines. – Ajay Feb 12 '14 at 13:48
  • how to convert audio file to text file objective ? – Ramani Hitesh Mar 06 '18 at 12:24
  • @RamaniHitesh Checkout Google Cloud APIs, https://cloud.google.com/speech/ They have a powerful set of APIs for audio to text conversion – Ajay Mar 06 '18 at 12:32
  • my project concept any mp3, audio file .wav file to convert text format objective c but in this concept like Speech Recognizer something so please any other ideas how is there in this topic so please let me know – Ramani Hitesh Mar 06 '18 at 12:59
1

AVSpeechSynthesizer Tutorial – Letting Your App Speak Like Siri

avspeechsynthesizer-ios-text-speech-ios-7

but this is only available iOS 7

enter image description here

sample app

codercat
  • 22,873
  • 9
  • 61
  • 85
0

In the previous version of IOS 7 use flute library http://artofsystems.blogspot.in/2009/02/speech-synthesis-on-iphone-with-flite.html

For IOS 7 there is inbuilt feature for Text to speech conversion avspeechsynthesizer-ios-text-speech-ios-7

rahul
  • 178
  • 5