ef-audio

Plays an audio file. Renders no visual output.

Set fft-size if you want to pair the element with ef-waveform for visualization.

Attributes

AttributeReact propTypeDefaultDescription
durationdurationstringHow long this element is active (CSS time, e.g. `"5s"`).
fft-decayfftDecaynumber8Decay frames averaged into {@link getFrequencyData} (default 8).
fft-gainfftGainnumber3Linear gain applied before frequency analysis (default 3.0).
fft-sizefftSizenumber128FFT window size for {@link getFrequencyData}/{@link getTimeDomainData} (rounded to a power of two, default 128).
file-idfileIdstring | nullCloud file identifier — resolves to `${apiHost}/api/v1/files/${fileId}`, taking priority over `src`.
interpolate-frequenciesinterpolateFrequenciesbooleanfalseSmooths {@link getFrequencyData} bins by interpolating between FFT bands instead of nearest-neighbor sampling.
looploopbooleanfalseLoop attribute — when this temporal is a self-driving root under a {@link PlaybackController}, the controller wraps back to `0` instead of pausing at `duration`.
mutemutedbooleanfalseMutes this element's audio.
offsetoffsetnumberStart offset (seconds) within a parallel (`fixed`/`contain`/`fit`) parent timegroup.
sourceinsourceinstringStart time within the source file (CSS time, e.g. `"1.5s"`).
sourceoutsourceoutstringEnd time within the source file (CSS time, e.g. `"1.5s"`).
srcsrcstringURL of the source audio file.
trimendtrimendstringTrims this much off the end of the source (CSS time).
trimstarttrimstartstringTrims this much off the start of the source (CSS time).
volumevolumenumber1Audio volume (0.0 to 1.0).

Events

EventDetailDescription
child-duration-changed{ duration: number }Fires on the nearest context-providing ancestor, when a nested media element's duration becomes known or changes.