Matlab中的dsp.AudioFileReader函数的认识和学习

在Matlab中的dsp.AudioFileReader函数的认识和学习

Stream from audio file
来自音频文件的流

1.描述

dsp.AudioFileReader系统对象™ 从音频文件读取音频样本。
要从音频文件读取音频样本,请执行以下操作:
1.创建dsp.AudioFileReader对象并设置其属性。
2.用参数调用对象,就像它是一个函数一样。
要了解有关系统对象如何工作的更多信息,请参阅什么是 系统对象(System object)?

2.语法

  1. afr = dsp.AudioFileReader
  2. afr = dsp.AudioFileReader(File name)
  3. afr = dsp.AudioFileReader(Name,Value)

2.1 语法描述

  1. afr = dsp.AudioFileReader returns an audio file reader System object, afr that reads audio from an audio file.

    afr=dsp.AudioFileReader返回一个音频文件读取器系统对象,afr从音频文件中读取音频。

  2. afr = dsp.AudioFileReader(File name) returns an audio file reader object, afr, with Filename property set to File name.

    afr=dsp.AudioFileReader(File name)返回一个音频文件读取器对象afr,利用Filename属性设置File name。

  3. afr = dsp.AudioFileReader(Name,Value) returns an audio file reader System object, afr, with each specified property set to the specified value. Enclose each property name in single quotes. Unspecified properties have default values.

    afr=dsp.AudioFileReader((Name,Value)返回音频文件读取器系统对象afr,每个指定属性设置为指定值。将每个属性名称用单引号括起来。未指定的属性具有默认值。

2.2 属性Properties

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

(1)Filename
Filename — Name of audio file from which to read
‘speech_dft.mp3’ (default) | character vector | string scalar

(2)PlayCount
PlayCount — Number of times to play file
1 (default) | positive integer

(3)SamplesPerFrame
SamplesPerFrame — Number of samples in audio frame
1024 (default) | positive integer

(4)OutputDataType
OutputDataType — Data type of output
‘double’ (default) | ‘single’ | ‘int16’ | ‘uint8’

(5)FilenameIsTunableInCodegen
FilenameIsTunableInCodegen — Enable file name tunability in generated code
false (default) | true

(6)CodegenPrototypeFile
CodegenPrototypeFile — Prototype audio file for code generation
‘speech_dft.mp3’ (default) | character vector | string scalar

(7)SampleRate
SampleRate — Sampling rate of audio file
positive scalar

(8)ReadRange
ReadRange — Range of samples to be read
[1 inf] (default) | two-element row vector

2.3 举例

在命令行窗口运行,下列指令

s1= dsp.AudioFileReader('speech_dft.mp3','ReadRange',[1 3*22050]);

得到
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值