I use AVSpeechSynthesizer to play text books via audio.
private lazy var synthesizer: AVSpeechSynthesizer = {
let synthesizer = AVSpeechSynthesizer()
synthesizer.delegate = self
return synthesizer
}()
let utterance = AVSpeechUtterance(string: text)
utterance.voice = AVSpeechSynthesisVoice(
language: languageIdentifier(from: language)
)
synthesizer.speak(utterance)
I want to update information in iPhone's default player view (probably naming is wrong ):
- indicate playing Chapter with some text
- enable next button to play the next chapter
How can I accomplish this?

I really don't think you want to hack your way through this.. But if you really do I would:
UIApplication.sharedApplication().beginReceivingRemoteControlEvents(), see Apple Sample ProjectMPNowPlayingInfoCenter:MPNowPlayingInfoCenter.default().nowPlayingInfo[MPMediaItemPropertyTitle] = "Title"AVSpeechSynthesizerDelegateand try to map the delegate functions to playback states and estimate the playback progress usingspeechSynthesizer(_:willSpeakRangeOfSpeechString:utterance:)(idk if possible)usesApplicationAudioSessionproperty ofAVSpeechSynthesizerto have more control over the audio session (set categories etc.)