RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.1, Nov 17, 2026

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • audioinfo
    • audioread

audioinfo — Read metadata from an audio file.

info = audioinfo(filename) returns a metadata structure without decoding sample data.

Syntax

info = audioinfo(filename)

Inputs

filename
Type
StringScalar
Required
Yes
Description
Audio file path.
NameTypeRequiredDefaultDescription
filenameStringScalarYes—Audio file path.

Returns

info
Type
Any
Description
Audio metadata structure.
NameTypeDescription
infoAnyAudio metadata structure.

Errors

RunMat:audioinfo:InvalidArgument
When
Filename is missing or cannot be interpreted as a scalar path.
Message
audioinfo: invalid filename
RunMat:audioinfo:Io
When
The audio file cannot be read.
Message
audioinfo: unable to read file
RunMat:audioinfo:UnsupportedFormat
When
The file is not a supported audio container or has malformed metadata.
Message
audioinfo: unsupported or invalid audio file
IdentifierWhenMessage
RunMat:audioinfo:InvalidArgumentFilename is missing or cannot be interpreted as a scalar path.audioinfo: invalid filename
RunMat:audioinfo:IoThe audio file cannot be read.audioinfo: unable to read file
RunMat:audioinfo:UnsupportedFormatThe file is not a supported audio container or has malformed metadata.audioinfo: unsupported or invalid audio file

Inputs and fields

The filename is scalar string, singleton string array, or one-row character array. The active filesystem provider supplies the file. The result is a host scalar structure with Filename, CompressionMethod, NumChannels, SampleRate, TotalSamples, Duration, BitsPerSample, BitRate, FileSize, and Format fields.

When headers do not establish a field, TotalSamples, Duration, BitsPerSample, or BitRate is NaN; the field is retained rather than omitted.

When the caller explicitly discards the result, audioinfo still reads and validates the file but does not construct or retain the metadata structure.

For WAVE_FORMAT_EXTENSIBLE, BitsPerSample reports valid sample precision; the encoded container may be wider. audioread(..., 'native') chooses its integer storage from the container width.

Containers and limits

WAV/RF64 RIFF, FLAC STREAMINFO, AIFF/AIFC COMM, Ogg/Vorbis identification headers, and MPEG audio frame headers are recognized. Malformed or unsupported data raises a format error rather than partial metadata.

MP3 information is estimated from the first valid MPEG frame header following an optional ID3v2 tag; variable-rate duration can differ from decoded duration. Inspection reads at most a 1 MiB prefix and, for larger Ogg files, an additional 64 KiB tail.

Execution

Metadata inspection is host filesystem I/O, a fusion boundary, and never a GPU kernel. It consumes no GPU-resident numeric input and returns a host struct. audioinfo does not decode samples; use audioread for supported WAV/RF64 sample payloads.

When a finite host-memory budget is active, the complete metadata call is admitted before opening the file. If the installed host resource service cannot establish complete bounds for the captured filesystem and metadata work, the call fails without reading the file. Calls without a finite host-memory budget retain the ordinary metadata path when no measured route is selected.

Examples

Read WAV metadata and duration

info = audioinfo('sample.wav');
info.SampleRate
info.NumChannels
seconds = info.Duration;
frames = info.TotalSamples;

Expected output:

ans = 8000
ans = 1

Inspect FLAC duration and sample count

info = audioinfo('speech.flac');
seconds = info.Duration;
frames = info.TotalSamples;
seconds
frames

Expected output:

seconds = 2
frames = 96000

Using audioinfo with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how audioinfo changes the result.

Run a small audioinfo example, explain the result, then change one input and compare the output.

FAQ

Does audioinfo decode audio samples?⌄

No. It reads container metadata only; sample decoding belongs to audioread.

Which formats are supported?⌄

WAV/RF64, FLAC, AIFF/AIFC, Ogg/Vorbis, and MPEG audio frame headers, including common MP3 files.

Why are some fields NaN?⌄

Some compressed formats do not expose exact sample count, bit depth, or duration in their primary headers. RunMat preserves the field shape and uses NaN for unavailable metadata.

Related Io functions

Audio

audioread

Net

accept · read · readline · tcpclient · tcpserver · write

Repl Fs

addpath · cd · copyfile · delete · dir · exist · fileattrib · fileparts · filesep · fullfile · genpath · getenv · getpref · isenv · isfile · isfolder · ispref · ls · matlabroot · memmapfile · memmapfile.subsasgn · memmapfile.subsref · mkdir · movefile · open · opentoline · path · pathsep · pcode · pwd · readstruct · rehash · restoredefaultpath · rmdir · rmpath · run · savepath · setenv · setpref · system · tempdir · tempname · uigetdir · uigetfile · uiputfile · unsetenv · userpath · what · winqueryreg · xmlread · xmlwrite

Tabular

arrayDatastore · csvread · csvwrite · detectImportOptions · dlmread · dlmwrite · fileDatastore · getvaropts · parquetDatastore · parquetinfo · parquetread · readcell · readmatrix · readtable · readtimetable · setvaropts · setvartype · spreadsheetImportOptions · writecell · writematrix · writetable · writetimetable · xlsread · xlswrite

Io

clc · diary · disp · display · format · input

Data

commit · data.copy · data.create · data.delete · data.exists · data.export · data.import · data.inspect · data.list · data.move · data.open · DataArray.chunk_shape · DataArray.codec · DataArray.dtype · DataArray.fill · DataArray.name · DataArray.rank · DataArray.read · DataArray.resize · DataArray.shape · DataArray.write · Dataset.array · Dataset.arrays · Dataset.attrs · Dataset.begin · Dataset.get_attr · Dataset.has_array · Dataset.id · Dataset.path · Dataset.refresh · Dataset.set_attr · Dataset.set_attrs · Dataset.snapshot · Dataset.version · DataTransaction.abort · DataTransaction.commit · DataTransaction.create_array · DataTransaction.delete_array · DataTransaction.fill · DataTransaction.id · DataTransaction.resize · DataTransaction.set_attr · DataTransaction.set_attrs · DataTransaction.status · DataTransaction.write

Filetext

fclose · feof · fgetl · fgets · fileread · filewrite · fopen · fprintf · fread · frewind · fwrite · readlines · writelines

Archive

gunzip · gzip · unzip

Hdf5

h5disp · h5info · h5read · h5write · h5writeatt · hdf5info · hdf5read · hdf5write

Import

importdata · textscan

Json

jsondecode · jsonencode

Mat

load · matfile · matlab.io.MatFile.subsasgn · matlab.io.MatFile.subsref · save

Http

sendmail · urldecode · urlencode · weboptions · webread · websave · webwrite

Source you can read

Every RunMat function's source is public. Read exactly how audioinfo is executed, line by line, in Rust.

  • View the source for audioinfo in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • Inputs and fields
  • Containers and limits
  • Execution
  • Examples
  • Read WAV metadata and duration
  • Inspect FLAC duration and sample count
  • Using audioinfo with coding agents
  • FAQ
  • Related Io functions
  • Audio
  • Net
  • Repl Fs
  • Tabular
  • Io
  • Data
  • Filetext
  • Archive
  • Hdf5
  • Import
  • Json
  • Mat
  • Http
  • Source you can read
  • About RunMat