info
Read a file’s stream parameters from the header, without decoding any audio. Works on paths and on bytes, for every supported format.
specux.audio.info(path, *, track=0)nfo = specux.audio.info("song.m4a")nfo.frames, nfo.samplerate, nfo.channels, nfo.format, nfo.tracksnfo.duration # seconds, frames / sampleratetrack: which audio stream to describe in a multi-track container;trackson the result says how many there are.- Frame counts for lossy formats come from the container and can be off by a priming/padding block; the decoded array from load is the exact truth.
Use it to size buffers, filter a corpus by sample rate, or pick a track
before committing to a full decode.