Information about a digital audio file can be recovered by using a built-in function: audioinfo.

 

The basic syntax for using the function is the following:

 

info = audioinfo(filename)
 

Input Variable:

filename – a string containing the name of the file. Example: ‘testSignal.wav’ 

 

Output Variables:

info – a structure containing the following pieces of information about the file.

info.Filename – a string of the sound file’s name.

info.CompressionMethod – a string describing the method of data compression.

info.NumChannels – a scalar describing whether the file is mono (1) or stereo (2).

info.TotalSamples – a scalar representing the number of samples per channel.

info.Duration – a scalar representing the length of the file in seconds.

info.BitsPerSample – a scalar representing the bit depth of the file.

 

 

Further documentation for the function is available here.

Links to other related functions: audioread, sound, audiowrite

Receive Updates

No spam guarantee.