Problem with AddAudioInputChannel: "Index exceeds the number of array elements (0)."

1 次查看(过去 30 天)
clear;
daqreset;
dev = daq.getDevices
session_snd = daq.createSession('directsound')
sndID = dev(3).ID
ch_snd = addAudioInputChannel(session_snd, sndID, 1)
I am trying to use a sound interface using the daq tool box. I wrote the following code for a preliminary test, but encountered the error in the title. I cannot find out what this message means. Could anyone help me to solve this problem?
  1 个评论
Walter Roberson
Walter Roberson 2020-3-9
Your code pulls out sndID from device 3, but we do not know that device 3 is the same as the directsound device.
We also do not know that any directsound devices were found or that there are any channels available if they are.
The error hints that the driver for directsound was found but no devices with it.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simultaneous and Synchronized Operations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by