readall

Read all audio files from datastore

Syntax

data = readall(ADS)

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 =

  29x1 cell array

    {  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}
    { 1265935x2  double}
    {  505726x2  double}
    {  550656x2  double}
    { 3195904x2  double}
    { 6960000x2  double}
    {26300000x1  double}
    {   39922x1  double}
    {  411648x1  double}
    {  989184x1  double}
    {  796672x2  double}
    { 8000000x1  double}
    { 1600000x1  double}
    { 1012748x2  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