%% Write Audio Data Set to New Location
% Create an audioDatastore object that points to the WAV audio samples included with Audio Toolbox™. The audioDatastore object includes read-only properties indicating the supported file formats, and the default output format (WAV).

folder = fullfile(matlabroot,'toolbox','audio','samples');
ads = audioDatastore(folder,'FileExtensions','.wav')

%
% Write the audio data set to your current folder. Save all files in the default (WAV) format.

outputLocation = pwd;
writeall(ads,outputLocation)

%
% The folder, samples, and the audio files that the folder contains have been written to your current folder.

dir samples

% Copyright 2019 The MathWorks, Inc.