readall

Read all audio files from datastore

Description

example

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.

Examples

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.

readall(ADS)
ans=29×1 cell
    { 539648x1  double}
    { 320512x4  double}
    { 227497x1  double}
    {   8000x1  double}
    { 685056x1  double}
    { 882688x2  double}
    {  24000x1  double}
    {1116283x2  double}
    {1215360x2  double}
    { 263304x16 double}
    { 180224x1  double}
    {  32768x1  double}
    {6076484x2  double}
    { 112893x1  double}
    { 913152x1  double}
    { 913152x1  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.

Introduced in R2018b