Progressive audio playback for AudioMedia handles with a
uniform surface across PCM (streamed) and container (HTMLAudioElement)
strategies.
Strategy selection is derived from media.mimeType and may be
overridden via options.strategy. PCM / L16 / WAV all flow through
the progressive Web Audio path; every other mime uses a hidden
HTMLAudioElement.
PCM strategy. Chunks are decoded in real time and scheduled on
a single AudioContext; playback begins within one chunk of the
first byte. seek / duration are undefined because random
access on a live scheduled buffer is not supported.
Element strategy. status stays in "buffering" until
message-finish materialises a blob URL; the element then owns
playback. seek / duration are available.
Both strategies expose level, getFrequencyData(), and
getTimeDomainData() by tapping an AnalyserNode in the
audio graph.
React StrictMode's simulated unmount/remount is safe: the shared reader and replay buffer mean a second attach sees the same bytes that the first one did.
useAudioPlayer(media: AudioMedia | undefined, options: UseAudioPlayerOptions): AudioPlayerHandle| Name | Type | Description |
|---|---|---|
media* | AudioMedia | undefined | Audio handle from |
options | UseAudioPlayerOptions | Strategy overrides and PCM format hints. |