Main Content


Read all audio files from datastore



data = readall(ADS) reads all audio files from the datastore.

If all the data in the datastore does not fit in memory, then readall returns an error.


collapse all

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);

Read all the data in the datastore.

ans=34×1 cell array
    { 539648x1  double}
    { 320512x4  double}
    { 227497x1  double}
    {   8000x1  double}
    { 685056x1  double}
    { 882688x2  double}
    {  24000x1  double}
    { 175104x1  double}
    {1116288x2  double}
    {1215360x2  double}
    { 263304x16 double}
    { 100868x1  double}
    { 180224x1  double}
    {  32768x1  double}
    { 192150x1  double}
    { 100352x1  double}

Input Arguments

collapse all

Specify ADS as an audioDatastore object.

Output Arguments

collapse all

All files in the audio datastore, returned as a cell array where each cell corresponds to a file.

Version History

Introduced in R2018b