function ShowPlayList()

% A cell array of strings that name available .wav files...
WaveFileNames = {'austin', 'sp_beam', 'sp_oz6', 'BackToSchool', 'noCry'};

% Build the playlist...
P = MakePlayList(WaveFileNames);

% Rune the playlist...
RunPlayList(P);



  function SA = MakePlayList(wNames)
% Build a struct array SA such that 
%   SA(k).data  stores the data of the wav file wNames{k}
%   SA(k).rate  stores the sampling rate of wav file wNames{k}

for k= 1:length(wNames)
   [y,rate] = wavread(wNames{k});
   SA(k)= struct('data', y, 'rate', rate);
end

function RunPlayList(SA)
% Play the sound data stored in struct array SA.
%   SA(k).data  stores the k-th segment of sound data (from wavread)
%   SA(k).rate  is the sampling rate of the k-th segment

for k= 1:length(SA)
    theData= SA(k).data;
    theRate= SA(k).rate;
    sound(theData,theRate)
    % Pause long enough for the track to play..
    L = length(theData)/theRate;
    pause(L+1)
end