USB Sound Device Possible?

I have the data acquisition toolbox.
I need to be able to have 8 USB speakers (connected by a USB hub) that I can activate to play a sound from only one speaker at a time.
Can MATLAB support USB sound devices? If so, can it support multiple USB sound devices individually?
How would I go about getting the name of the device so that I can call it from an M-file?

 채택된 답변

Daniel Shub
Daniel Shub 2011년 10월 5일

0 개 추천

MATLAB can support multiple USB sound devices. The audioplayer function allows you to specify the device ID number. In Linux, you can control the ID number a device gets at boot time. I am not sure you can do that in Windows.
Running multiple devices on a single USB hub may not work. The hub may not have the bandwidth to do that.
I would suggest looking at port audio (e.g., pawavplay, paplayrec, or the psychtoolbox) instead of the built in sound commands.
Finally if you only want a single sound at a give time, you should look at a programmable switch (either powered or not) that would let you route a single channel of output from a soundcard to different speakers. This might be much more reliable and easier to calibrate.

댓글 수: 2

RAJKUMAR Palaniappan
RAJKUMAR Palaniappan 2012년 4월 19일
i want to interface 3 microphones using USB sound card and collect data using matlab, is it possible to do that? im using windows 7
i want to collect data simultaneously
Daniel Shub
Daniel Shub 2012년 4월 19일
If something about this answer does not answer your question, then ask a new question linking to this question/answer and explain why it is different. Linking and explaining why it is different is crucical, because otherwise I am just going to point you back here.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Walter Roberson
Walter Roberson 2011년 10월 5일

0 개 추천

It is my understanding that USB device names are variable, and can change if you unplug and replug a device, or upon reboot. If you have a series of USB devices that are functionally all the same, then unless the USB device is able to store some kind of identifier on it, you pretty much end up selecting on the basis of device serial number.
A USB speaker would have to be treated as a digital i/o device, and could not be treated via analoginput(); digitalio() would have to be used. If daqhwinfo does not report the device, it would not be usable (unless drivers can be found for it.) The "adapter" in this situation would probably be 'winsound'.
Alejandro Bidondo
Alejandro Bidondo 2012년 1월 11일

0 개 추천

Hi Brittany.
All you need is PsychPortAudio Driver, from the PsychToolBox 3 package ( http://docs.psychtoolbox.org/Psychtoolbox).
Its easy to install in Matlab. It has the control functions you need. You will also have to use ASIO sound cards, with their own ASIO driver or the ASIO4ALL universal driver.
It works. I've used it for reproducing different audio files thru 4 speakers, all at the same time. Hope this helps.
Alejandro.

댓글 수: 5

RAJKUMAR Palaniappan
RAJKUMAR Palaniappan 2012년 4월 19일
i want to interface 3 microphones using USB sound card and collect data using matlab, is it possible to do that? im using windows 7
RAJKUMAR Palaniappan
RAJKUMAR Palaniappan 2012년 4월 19일
i want to collect data simultaneously
Walter Roberson
Walter Roberson 2012년 4월 19일
No it is not possible, Rajkumar. USB is a serial bus that can only transfer data for one device at any one time (per hub). USB has no provision for synchronizing different hubs. You are thus always going to have synchronization problems between the channels if you proceed that way.
You need to use a data acquisition device instead. Data acquisition device can record multiple channels simultaneously (using the same internal or external trigger for each), and then you can transfer the simultaneously-sampled data from the device.
Daniel Shub
Daniel Shub 2012년 4월 19일
@Walter USB soundcards tend to have limited memory buffers which allow them to get around single data transfer, but introduce input/output latency. I beleive some high end soundcards provide a way of linking multiple cards together to synchronize them.
Walter Roberson
Walter Roberson 2012년 4월 19일
Buffers do not in themselves solve synchronization; you would need a common trigger. But if the devices have a common sync... that could work (though with latency as you point out.)

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Data Acquisition Toolbox Supported Hardware에 대해 자세히 알아보기

질문:

2011년 10월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by