File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 196196
197197 InitializePsychSound
198198 d = PsychPortAudio(' GetDevices' );
199- d = d([d .NrOutputChannels ] == 2 );
200- [~ ,I ] = min([d .LowOutputLatency ]);
201- obj.Hardware.audioDevices = d(I );
202- obj.Hardware.audioDevices.DeviceName = ' default' ;
199+
200+ % Keep output devices
201+ d = d([d .NrOutputChannels ] > 0 );
202+ obj.Hardware.audioDevices = d([d .NrOutputChannels ] > 0 );
203+
204+ % Select the lowest latency stereo output as the default
205+ stereo = [d .NrOutputChannels ] == 2 ;
206+ [~ ,I ] = min([d(stereo ).LowOutputLatency]);
207+ I = I + sum(~stereo(1 : I ));
208+ if isempty(I )
209+ warning(' Rigbox:eui:SignalsTest:NoStereoOutput' , ...
210+ ' No stereo output audio devices detected; default unassigned' )
211+ else
212+ obj .Hardware .audioDevices(I ).DeviceName = ' default' ;
213+ end
203214 else
204215 obj.Hardware = rig ;
205216 end
Original file line number Diff line number Diff line change 8080% * |git.repoVersion| - Returns release tag of repository, if available
8181% * |eui.AlyxPanel| - The database URL can now be set via a UI context menu
8282% or by passing a URL to the constructor.
83+ % * |eui.SignalsTest| - Warning instead of error when no stereo output
84+ % device found
8385%
8486% *Tests*
8587%
You can’t perform that action at this time.
0 commit comments