Sent from Yahoo Mail for iPhone
On Friday, August 4, 2017, 17:28, qwc6pvpeyixqzf6zq3ycc7yzuey27z2jszrnsw2m@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:
I have to run some wav file in random sequence.
I did this sound function:
function playWord();
wavfilename= {'words.wav' };
[y, freq] = audioread(wavfilename);
wavedata = y';
nrchannels = size(wavedata,1);
if nrchannels==1
wavedata = [wavedata ; wavedata];
nrchannels = 2;
end
pahandle = PsychPortAudio('Open', [], [], 0, freq, nrchannels);
PsychPortAudio('FillBuffer', pahandle, wavedata);
sounds_onset=PsychPortAudio('Start', pahandle, 1, 0, 1);
PsychPortAudio('Stop', pahandle);
PsychPortAudio('Close', pahandle);
end
it works when wavfilename is made by a single item, but not with a series of simuli.
It always gives me this error:
Error using audioread (line 74)
The filename specified was not found in the MATLAB path.
Error in playWord (line 12)
[y, freq] = audioread(wavfilename);
All stimuli are present in the current folder.
Any helps?