Main Content

preview

Read first file from datastore for preview

Description

example

data = preview(ADS) always reads the first file from ADS. preview does not affect the state of ADS.

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

Preview the data in the audio datastore.

data = preview(ADS);
plot(data)

Figure contains an axes. The axes contains an object of type line.

Input Arguments

collapse all

Specify ADS as an audioDatastore object.

Output Arguments

collapse all

Subset of data, returned as an array of audio samples.

Introduced in R2018b