如何管理ASIO驱动

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何管理ASIO驱动相关的知识,希望对你有一定的参考价值。

参考技术A How to manage ASIO drivers

ASIO (Audio
Stream Input/Output) is a sound card driver protocol for digital audio specified
by Steinberg, providing a
low-latency and high fidelity interface between a software application and a
computer's sound card. ASIO bypasses the normal audio path from the user
application through layers of intermediary Windows operating system software, so
that the application connects directly to the hardware of the sound card. Each
layer that is bypassed means a reduction in latency, the delay between an
application sending sound to the sound being reproduced by the sound card.

By default Audio
Sound Recorder enumerates input devices (sound cards) supporting the
DirectSound protocol: in order to let Audio Sound Recorder enumerating devices
supporting ASIO drivers, you need to make a call to the InitDriversType方法 method and to
specify which kind of drivers/protocols your application will support and, in
case you should need supporting both ASIO and DirectSound at the same time, in
which order; if a certain sound card should support both DirectSound and ASIO
drivers, it would be enumerated as two different sound cards, one supporting
DirectSound and one supporting ASIO.

IMPORTANT
NOTE: When using the Audio Sound
Recorder component in conjunction with our Audio DJ Studio component,
which also contains the InitDriversType方法 method, it should be preferred calling
the InitDriversType方法 method from Audio DJ Studio so it will
automatically affect both input and output devices.

The call to the InitDriversType方法 method is
mandatory before performing calls to the InitRecordingSystem方法, GetInputDevicesCount方法 and GetInputDeviceDesc方法 methods: if
the InitDriversType方法 method should be called at a later time,
it would report back an error; if for any reason you should need calling it at a
later time, you would need performing the following sequence of calls:

1. ResetEngine方法 method

2. InitDriversType方法 method

3. Eventual new
enumeration of input devices through the GetInputDevicesCount方法 and GetInputDeviceDesc方法 methods.

4. ResetControl方法 method

After having initialized the type of driver(s) in
use through the InitDriversType方法 method, it will be possible enumerating
available input devices through the GetInputDevicesCount方法 and GetInputDeviceDesc方法 methods:
depending upon the driver set, these methods will return the overall list of
available input devices (DirectSound + ASIO) so it will be possible setting them
inside the nDeviceIndex
parameter of the StartFromAsioDevice方法 method. You can also obtain the
driver in use by a specific input device through the GetInputDeviceDriverType方法
method.

If the InitDriversType方法 method should be set to initialize the
use of ASIO devices, you could access specific ASIO features through methods
exposed by the ASIO
property which implements the ASIOMan
class:

·
Enumerating available ASIO devices through the ASIO.DeviceGetCount方法 and ASIO.DeviceGetDesc方法 methods: it's important to note that
this kind of enumeration will only report existing ASIO devices and not the
overall list of available input devices as reported by the GetInputDevicesCount方法 and GetInputDeviceDesc方法
methods.

·
Obtaining the zero-based index of an ASIO device inside the overall list of
available input devices through the ASIO.DeviceGetInputIndex方法
method.

·
Given the zero-based index of an ASIO device inside the overall list of
available output devices, obtaining the zero-based index of the same ASIO device
inside the list of available ASIO devices through the ASIO.DeviceGetIndexFromIntput方法
method.

·
For each ASIO device, enumerating the list of available input and output
channels through the ASIO.DeviceGetChannelsCount方法 and ASIO.DeviceGetChannelDesc方法
methods.

·
Displaying the control panel provided by the ASIO driver of a specific
device through the ASIO.ControlPanelDisplay方法
method.

·
Obtaining the absolute pathname of the file containing the ASIO driver of a
specific ASIO device through the ASIO.DeviceGetDriverPathname方法
method.

·
Starting and stopping the usage of a specific ASIO device through the ASIO.DeviceStart方法
and ASIO.DeviceStop方法 methods.

The call to the ASIO.DeviceStart方法 method is
mandatory in order to be able starting a recording session on a specific ASIO
device. You can know if a specific ASIO device is already started through the ASIO.DeviceIsStarted方法 method.

IMPORTANT
NOTE: When using Audio Sound
Recorder in conjunction with Audio DJ Studio, you
should prefer calling this method using the same ASIO.DeviceStart method available inside Audio DJ
Studio so you would have a better control over the playback mode.

After starting an ASIO device, it will be possible
performing the following tasks:

·
Starting a recording session on the device through the StartFromAsioDevice方法
method.

·
Getting and setting the volume for input and output channels through the ASIO.DeviceMasterVolumeGet方法 and ASIO.DeviceMasterVolumeSet方法 methods (applies the same
volume level to all channels in one shot) and through the ASIO.DeviceChannelVolumeGet方法 and ASIO.DeviceChannelVolumeSet方法 methods (applies the volume
level on a specific channel allowing separate volume level for each
channel).

·
Obtaining the current latency, expressed in samples per second, for input
and output channels as reported by the ASIO driver
itself.

When dealing with sound cards having multiple input channels, like the M-Audio Delta
1010LT, there is the possibility to mix the input of all of the channels into
one single recording session or, by using multiple instances of Audio Sound Recorder, you can record at the
same time each channel or couple of channels on a separate destination file.
Let's see these situations with a couple of small snippets of code.

In the first sample we need to record the first 8
input channels of an ASIO device selected from the comboInputDevices combobox and mix all of the
channels inside the same output file:本回答被提问者和网友采纳

以上是关于如何管理ASIO驱动的主要内容,如果未能解决你的问题,请参考以下文章

asio驱动到底怎么装,怎么用?折腾了一天!

ASIO 设备/驱动程序属性

什么是asio?

FOOBAR2000怎样正确安装音频驱动ASIO提升音质

C++ ASIO 驱动设置

声卡不支持ASIO是啥意思?