How to identify the default audio device

18 Ansichten (letzte 30 Tage)
Do.
Do. am 20 Mär. 2017
Kommentiert: Alain Kuchta am 20 Apr. 2017
Calling audioplayer with ID=-1 will use the default output audiodevice, but how can I know which one is the default when I have multiple devices availabe on the system ? I tried audiodevinfo(0,-1), but this returns an error. Is the default always the first device on the list returned by audiodevinfo ?

Antworten (1)

Alain Kuchta
Alain Kuchta am 22 Mär. 2017
The default audio device for recording or playing sound is determined by the operating system and is typically a user-customization preference. For example, in Windows 10, default audio devices are selected via Control Panel -> Hardware and Sound -> Sound.
MATLAB uses the default audio device as selected by the operating system. The default is not always the first device on the list returned by audiodevinfo.
Can you give more detail about the workflow for which you need to know which audio device will be used as the default?
  2 Kommentare
Do.
Do. am 23 Mär. 2017
I use audioplayer with the default output device to play sounds in a routine used for experiments. I assume the default playback device will be correctly selected by the user (me or another) in the OS settings when the experiment is performed, but these are likely to be changed by other users between two experiments, so I would like to automatically save this information along with the results of the experiment, in a MAT file, so as to be able to check the settings in retrospect when I analyze the results.
So if I understand correctly, MATLAB just passes the information to the OS that the default should be used, but cannot access the default settings information from the OS ? So there is no way to monitor and save the OS settings from MATLAB as I would like to do ?
Alain Kuchta
Alain Kuchta am 20 Apr. 2017
@Do. Yes, your understanding is correct.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by