Expand description
Audio waveform peaks per (file, audio stream): computed once on a background thread (decoding the
whole stream through an AudioSource), cached in memory and on disk under Settings::cache_dir()
(key = hash of path + file size + mtime + stream). PEAKS_PER_SEC buckets of mono (min, max).
StructsΒ§
- Peaks
- State π
- Waveform
Cache
ConstantsΒ§
FunctionsΒ§
- cache_
file π - compute_
peaks π - Sequentially decode
sourcein 4800-frame blocks into 10 ms mono (min, max) buckets. Stops at the first all-zero block at/afterduration(so an unknown duration of 0 stops at the first silent block). - load_
or_ πcompute - Disk cache first; else decode the whole stream (empty Peaks when the stream canβt be opened).
- mem_key π
- ponytail: 64-bit hash as the map key so the per-frame lookup allocates nothing β collisions are astronomically unlikely.