scanAudio

suspend fun scanAudio(media: MediaItem, track: TrackId? = null, range: AudioScanRange? = null, sink: AudioScanSink): AudioScanResult

scanAudio through this player's backend, with the reader rules of playback: the item's own reader factory, then a configured resolver, then automatic network providers. The playback byte cache is not shared. Null track picks what an open would, including preferred languages.

A reader factory must allow a second, concurrent open for the scan to be independent of a session that is playing the same item. Run this from a context that may block.

A range scans one stretch of the track instead of all of it, which lets several scans of the same item share the work. Each one opens its own session, so an item whose reader refuses a second concurrent open cannot be scanned this way.