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 Active Sound Recorder enumerates input devices (sound cards) supporting the DirectSound protocol: in order to let Active 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 Active Sound Recorder control in conjunction with our Active DJ Studio control, which also contains the InitDriversType method, it should be preferred calling the same InitDriversType method available inside Active 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
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 ASIO COM object:
|•||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.DeviceGetIndexFromInput 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 Active Sound Recorder in conjunction with Active DJ Studio, you should prefer calling this method using the same ASIO.DeviceStart method available inside Active 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 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 Active Sound Recorder, you can record at the same time each channel on a separate destination file: for this purpose check the StartFromAsioDevice method.
Samples of usage of ASIO drivers in C# and VB.NET can be found inside the following samples installed with the product's setup package: