# RDSpeechReaderView `RDSpeechReaderView` provides bounded, on-device text-to-speech playback for ReadViewSDK readers. It uses `AVSpeechSynthesizer` and does not upload book content or create exportable audio files. ## Install ```ruby pod 'RDSpeechReaderView' pod 'RDPDFReaderView/Speech' pod 'RDEpubReaderView/Speech' ``` The host app must enable the **Audio, AirPlay, and Picture in Picture** background mode to continue reading after it enters the background. ## Use with PDF ```swift let provider = reader.makeSpeechContentProvider() let speech = RDSpeechReaderController(contentProvider: provider) try await speech.start() ``` The PDF adapter reads `RDPDFReaderTextRun` values supplied by the host or by PDFKit. Image-only PDFs require an OCR-backed provider before they can speak. For automatic page navigation and temporary read-aloud highlighting, create a PDF session instead: ```swift let session = reader.makeSpeechSession() try await session.start(from: 0) ``` ## Use with EPUB ```swift let session = reader.makeSpeechSession() try await session.start() ``` EPUB/TXT 会话默认从当前阅读位置开始。文本重排 EPUB 与 TXT 会临时高亮当前朗读范围, 并且只在朗读跨页时定位;朗读位置使用 EPUB `href` 与 UTF-16 文本偏移,因此用户修改 字体或页面大小后仍可稳定恢复。