Esc

open

procedureextensionexperimentalsince 0.36.1Source
  • macOS: open works on macOS
  • Linux: open works on Linux
  • Windows: open works on Windows
  • Wasm: open works on Wasm

Opens a file and copies Vorbis ARTIST/ALBUM/TITLE comments. Returns false on unsupported or malformed headers, including Vorbis on WebAssembly, which has no native decoder. PCM 8/16/24/32-bit and IMA ADPCM, one or two channels, are accepted on every target.

Signature

open :: (r: *Reader, path: string) -> bool
Example↗
r: Reader;
if open(*r, "song.ogg") {
    defer close(*r);
    assert(r.rate > 0);
}

See also