Return true if there is more data in datastore
tf = hasdata(ADS)
hasdata returns a logical scalar indicating whether or not there is unread data in the datastore. You can use
audioDatastore to read files sequentially until all data is read.
Specify the file path to the audio samples included with Audio Toolbox™.
folder = fullfile(matlabroot,'toolbox','audio','samples');
Create an audio datastore that points to the specified folder.
ADS = audioDatastore(folder);
While the datastore has unread data, read from the datastore.
while hasdata(ADS) data = read(ADS); end
tf— Indication if data is available to read
Indication is data is available to read from the datastore, returned as