info

Information about specific audio file

Description

example

S = info(afr) returns a MATLAB® structure, S, with information about the audio file specified in the Filename property.

Examples

collapse all

Read an audio file using the dsp.AudioFileReader object. Obtain information related to the audio content of the file.

The dsp.AudioFileReader objects reads the default shipped file 'speech_dft.mp3'.

afr = dsp.AudioFileReader
afr = 
  dsp.AudioFileReader with properties:

           Filename: '/mathworks/devel/bat/Bdoc20a/build/matlab/toolbox/dsp/dsp/speech_dft.mp3'
          PlayCount: 1
    SamplesPerFrame: 1024
     OutputDataType: 'double'
         SampleRate: 22050
          ReadRange: [1 Inf]

The output structure displays the sample rate of the audio signal in Hz, number of bits used to encode the audio stream, and the number of audio channels.

S = info(afr)
S = struct with fields:
     SampleRate: 22050
        NumBits: 32
    NumChannels: 1

Input Arguments

collapse all

File reader, specified as a dsp.AudioFileReader System object™.

Output Arguments

collapse all

Information about the audio file specified in the Filename property, returned as a structure. The number of fields in the structure S varies depending on the audio content of the file. This table shows some of the fields that can appear in the structure S.

FieldValue
SampleRate Audio sampling rate of the audio file in Hz.
NumBitsNumber of bits used to encode the audio stream.
NumChannelsNumber of audio channels.

See Also

Functions

Objects

Introduced in R2012a