%% Read Data in Audio Datastore
% Specify the file path to the audio samples included with Audio Toolbox™. Create an audio datastore that points to the specified folder.

folder = fullfile(matlabroot,'toolbox','audio','samples');
ADS = audioDatastore(folder);

%
% While the audio datastore has unread files, read consecutive files from the datastore. Use progress to monitor the fraction of files read.

while hasdata(ADS)
    data = read(ADS);
    fprintf('Fraction of files read: %.2f\n',progress(ADS))
end

%
% Copyright 2018 The MathWorks, Inc.