info
Information about specific audio file
Syntax
Description
Examples
Obtain Information About Audio File
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/filer/batfs2561-0/Bdoc24b.2679053/build/runnable/matlab/toolbox/dsp/dsp/samples/speech_dft.mp3' PlayCount: 1 ReadRange: [1 Inf] SamplesPerFrame: 1024 OutputDataType: 'double' Use get to show all properties
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: 16
TotalSamples: 112320
Duration: 5.0939
NumChannels: 1
Input Arguments
afr
— File reader
dsp.AudioFileReader
(default)
dsp.AudioFileReader
File reader, specified as a dsp.AudioFileReader
System object™.
Output Arguments
S
— Audio file information
structure
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
.
Field | Value |
---|---|
SampleRate | Audio sampling rate of the audio file in Hz. |
NumBits | Number of bits used to encode the audio stream. |
NumChannels | Number of audio channels. |
Version History
Introduced in R2012a
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)