I have 3 Terratec Soundcards installed in my computer, with 6 soundchannels each. They all work properly. To use them in Matlab, I installed PsychToolBox and PsychPortAudio.
When I type:
d=PsychPortAudio('GetDevices',
3);
d;
Then I start this code and Matlab crashes (no error message, nothing):
repetitions = 1;
wavfilename = [ PsychtoolboxRoot 'PsychDemos' filesep
'SoundFiles' filesep
'funk.wav'];
[y, freq] = wavread(wavfilename);
wavedata = y';
nrchannels = size(wavedata,1); % Number of rows == number of
channels.
d=PsychPortAudio('GetDevices', 3);
d
pahandle = PsychPortAudio('Open', 4, [], 0, freq, 1,[],[],1);
PsychPortAudio('FillBuffer', pahandle, wavedata);
t1 = PsychPortAudio('Start', pahandle, repetitions, 0, 1);
WaitSecs(2);
% Stop playback:
PsychPortAudio('Stop', pahandle);
% Close the audio device:
PsychPortAudio('Close', pahandle);
And by the way:
1. How do I get a list of ALL soundcards that can be used (with their ID)?
2. How do I reference a specific soundchannel of a soundcard?
It looks very confing to me to see 18 channels in ONE device instead of having 3 devices with 6 channels each. I don´t really get that concept..
Best,
Ralf