Skip to Main Content Skip to Search
Accelerating the pace of engineering and science

How do I make use of all four channels of my four channel sound card using the Data Acquisition Toolbox?


Date Last Modified: Friday, June 26, 2009
Solution ID:   1-19SDX
Product:   Data Acquisition Toolbox
Reported in Release:   R12.1
Platform:   Windows
Operating System:   Windows Any
 

Subject:

How do I make use of all four channels of my four channel sound card using the Data Acquisition Toolbox?

Problem Description:

I am trying to acquire 4 channels simultaneously from a 4 channel soundcard using the Data Acquisition Toolbox. However, the 4 channels are presented as 2 Windows devices, so that in Windows --> Control Panel --> Multimedia, I am able to select channels 1 and 2 or channels 3 and 4. The MATLAB 'winsound' device only contains 2 channels, either 1 and 2 or 3 and 4.

Solution:

To see if MATLAB sees your soundcard as two analoginput objects, execute the following command:

daqhwinfo('winsound')
ans.InstalledBoardIds

If MATLAB sees more than one InstalledBoardIds, then MATLAB recognizes two separate analoginput objects for your soundcard (probably ID's 0 and 1).

If this is the case, than you can access all four channels by creating two analoginput objects like this:

ai1 = analoginput('winsound',0)
ai2 = analoginput('winsound',1)

Please provide feedback to help us improve this Solution
Contact support