I have converted text to speech using the AVSpeechSynthesizer
. When clicked on Play, converted speech plays. I don\'t know the extension of this audio file.
A simple strategy would be saving your output from AVSpeechSynthesizer
to a directory first, then changing its format.
But, as far as I know AVSpeechSynthesizer
does not let you save your outputs.
I would suggest you to check the following post: Save audio stream to mp3 file (iOS)
Quoting from IanStallings:
Unfortunately no, there is no public API available to capture the speaker output and looking over the docs for AVSpeechSynthesizer and related classes I don't see a way to capture any audio from it. You may want to look at 3rd party libraries to help with this.
And another one: AVSpeechSynthesizer output as file?
Again, quoting from Bhumit Mehta:
As of now AVSpeechSynthesizer does not support this . There in no way get the audio file using AVSpeechSynthesizer . I tried this few weeks ago for one of my apps and found out that it is not possible , Also nothing has changed for AVSpeechSynthesizer in iOS 8.