background-mode

Text To Speech functionality when app is in background mode?

和自甴很熟 提交于 2019-11-30 15:27:16
I am working on a TextToSpeech app. I write one paragraph in a UITextField , then I press the Speak button. Sound plays according to the text written in the UITextField . However, when the app is in background mode, the audio stops playing. How can I continue to play the sound in background mode? Similar to how an audio player can play a song in the background. I am using the following code for text to speech: #import "ViewController.h" #import "Google_TTS_BySham.h" #import <AVFoundation/AVFoundation.h> @interface ViewController () @property (nonatomic,strong)Google_TTS_BySham *google_TTS