y = audioread(filename)
[y, fs] = audioread(filename)
[y, fs] = audioread(filename, range)
[y, fs] = audioread(filename, type)
[y, fs] = audioread(filename, range, type)
| Parameter | Description |
|---|---|
| filename | a string: an existing filename. |
| range | a vector: [start end]. |
| type | a string: 'double' or 'native'. |
| Parameter | Description |
|---|---|
| y | a matrix: audio data. |
| fs | an integer value: sampling rate. |
audioread reads an audio file.
Supported format: 'wav', 'ogg', 'flac', 'mp3', 'caf', 'au', 'aiff'. See audiosupportedformats function to have all supported formats.
If type is 'native' then audio data depends on the file format (single, double, integers).
wav_audio = [modulepath('audio'), '/examples/haha.wav'];
[y, fs] = audioread(wav_audio);
playObj = audioplayer(y, fs);
playblocking(playObj)
delete(playObj)
clear playObj
| Version | Description |
|---|---|
| 1.0.0 | initial version |