USB Sound Device Possible?
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (2)
Walter Roberson
le 5 Oct 2011
0 votes
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
le 11 Jan 2012
0 votes
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 commentaires
RAJKUMAR Palaniappan
le 19 Avr 2012
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
le 19 Avr 2012
i want to collect data simultaneously
Walter Roberson
le 19 Avr 2012
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
le 19 Avr 2012
@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
le 19 Avr 2012
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.)
Catégories
En savoir plus sur Data Acquisition Toolbox Supported Hardware dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!