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?
採用された回答
その他の回答 (2 件)
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
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
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
2012 年 4 月 19 日
i want to collect data simultaneously
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
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
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 についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!