MATLAB Answers

alternative to audiodevinfo for DSP AudioPlayer and AudioRecord

4 views (last 30 days)
I was wondering if the DSP blocks have a way of listing the available audio devices in my computer similar to what the audiodevinfo function does? The problem I'm having is that when I use audiodevinfo it only returns a partial name of the available devices and not the full name of the device so I can't assign this name to the DeviceName parameter in dsp.AudioRecorder or dsp.AudioPlayer from the Command Window in MATLAB...
so, this is what I'm doing:
h = dsp.AudioPlayer;
h.DeviceName = audiodevinfo(0,1);
and, this is the error I get:
??? Error using ==> CompEnum.findMatch at 60 Communications Headphones (IDT is not a valid setting for the DeviceName property.
Error in ==> C:\Program Files\MATLAB\R2010b\toolbox\shared\system\+matlab\+system\@APIProp\APIProp.p>APIProp.checkForEnumProp at 433
I have tried:
devinfo = audiodevinfo;
and, I get:
ans =
Communications Headphones (IDT
ans =
Speakers and Headphones (IDT Hi
I can't use neither of these strings to specify the DeviceName property for dsp.AudioPlayer since none of them has the complete name of the device, therefore returning the aforementioned error.
The tab autocomplete option, for example for my first device, gives me:
h.DeviceName = 'Communications Headphones (IDT High Definition Audio CODEC)'
What I would like is to be able to get the complete names of the devices in order to use them in a popup list object in a GUI so I can assign them to the DeviceName property of dsp.AudioPlayer without using the tab completion for it.
Is there a way of doing this? I appreciate any help I can get!

Accepted Answer

Daniel Jimenez
Daniel Jimenez on 13 Mar 2014
I found in another question reply by chance that there IS a function that allows the display of the devices associated with the dsp toolbox, if you type in the command window:
This function returns a structure array with the name, and number of inputs and outputs available to use. Arguments for this function can be:
'all', 'defaultInput','defaultOutput', 'inputs', 'outputs', 'hostApiNames', 'hostApiIds', or 'defaultHostApi'.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by