Main Content

preview

Read first file from datastore for preview

Description

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

example

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 object. The axes object 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.

Version History

Introduced in R2018b