主要内容

Audio Device Reader

从声卡中记录

  • Library:
  • Audio Toolbox / Sources

  • 音频设备读取器块

描述

TheAudio Device Readerblock reads audio samples using your computer's audio device. TheAudio Device Readerblock specifies the driver, the device and its attributes, and the data type and size output from yourAudio Device Readerblock.

端口

Output

expand all

The output of theAudio Device Readerblock is determined by the block’s parameters. If the block output is a matrix, the columns correspond to independent channels.

Data Types:single|double|INT16|INT32|uint8

This port outputs the number of samples overrun while acquiring a frame of data (one output matrix).

Dependencies

To enable this port, select theOutput number of samples overrun范围。

Data Types:uint32

Parameters

expand all

主选项卡
  • ASIO驱动程序未在Windows机器上预安装。使用ASIO驱动程序选项,在MATLAB外安装ASIO驱动程序®.

    Note

    IfDriver被设定为ASIO, open the ASIO UI outside of MATLAB to set the sound card buffer size to the value specified by theSamples per frame范围。有关更多信息,请参见您的ASIO驱动程序的文档。

  • WASAPI drivers are supported for exclusive-mode only.

ASIO和WASAPI驱动程序不提供样本率转换。对于Asio和Wasapi驱动程序,设置Sample rate (Hz)to a sample rate supported by your audio device.

This parameter applies only on Windows machines. Linux machines always use the ALSA driver. Mac machines always use the CoreAudio driver.

设备列表填充了计算机上可用的设备。

此按钮打开一个对话框,该对话框列出了您所选的音频驱动程序,音频设备的全名以及配置的最大输入通道。例如:

The possible range ofSample rate (Hz)depends on your audio hardware.

The number of input channels is also the number of channels (matrix columns) output by theAudio Device Readerblock.

Dependencies

指定输入通道音频设备acquires, on the先进的tab, select the使用默认频道映射范围。

Samples per frame也是设备缓冲区的大小,以及帧大小(矩阵行的数量)输出Audio Device Readerblock.

先进的Tab

Data type used by device to acquire audio data, specified as a character vector or string.

当您选择此参数时,该块使用声卡的输入通道和该块输出的矩阵列之间的默认映射。清除此参数时,您指定映射设备input channels.

设备通道的非默认地图和矩阵输出Audio Device Reader块,指定为标量或向量。例如:

If设备input channels指定为1:3, then:

  • Channel 1 maps to the first column of the output matrix.

  • 通道2映射到输出矩阵的第二列。

  • Channel 3 maps to the third column of the output matrix.

If设备input channels指定为[3,1,2], then:

  • 通道3映射到输出矩阵的第一列。

  • 通道1映射到输出矩阵的第二列。

  • 通道2映射到输出矩阵的第三列。

Dependencies

To specify a nondefault mapping, clear theUse default mapping between sound card’s input channels and columns of output of this block范围。

When you select this parameter, an additional output port,O, is added to the block. TheOport outputs the number of samples overrun while acquiring a frame of data (one output matrix).

Data type of the output.

Note

If this parameter is specified asdouble或者single, the block outputs data in the range [–1, 1]. For other data types, the range is [min, max] of the specified data type.

块特征

Data Types

double|整数a|single

直接进料

Multidimensional Signals

Variable-Size Signals

Zero-Crossing Detection

aSupports 16- and 32-bit signed and 8-bit unsigned integers.

Extended Capabilities

Version History

Introduced in R2016a