How do I find built in sounds?

101 views (last 30 days)
Jarred
Jarred on 12 Dec 2014
Answered: Gabriele Bunkheila on 2 Feb 2026 at 8:25
I need to load two built in matlab sound files, store them, and concatenate the sounds so they play one immediately followed by the other. I cannot figure out how to even find built in sound files so I am stuck. Can anyone help me figure out the sound file codes?
  1 Comment
Chad Greene
Chad Greene on 15 Dec 2014
Many times I've wished for a clear list of sample data, perhaps in a simple table given with data type, toolbox, and in which Matlab release(s) you'll find each sample data file. Good documentation of code often requires sample data, and requires confidence that users will be able to follow along with an example, no matter what release of Matlab they're using or what toolboxes they have. I've contacted TMW with this request before and I got a friendly, but non-committal response.

Sign in to comment.

Accepted Answer

Adam Danz
Adam Danz on 16 Apr 2021
See Example Audio Data toward the bottom of this list.
help audiovideo
Audio and Video support. Audio input/output objects. audioplayer - Audio player object. audiorecorder - Audio recorder object. Audio Device utilities audiodevinfo - Audio device information. audiodevreset - Reset the list of audio devices. Audio hardware drivers. sound - Play vector as sound. soundsc - Autoscale and play vector as sound. Audio file import and export. audioread - Read audio samples from an audio file. audiowrite - Write audio samples to an audio file. audioinfo - Return information about an audio file. Video file import/export. VideoReader - Read video frames from a video file. VideoWriter - Write video frames to a video file. mmfileinfo - Return information for a multimedia file. Utilities. lin2mu - Convert linear signal to mu-law encoding. mu2lin - Convert mu-law encoding to linear signal. Example audio data (MAT files). chirp - Frequency sweeps (1.6 sec, 8192 Hz) gong - Gong (5.1 sec, 8192 Hz) handel - Hallelujah chorus (8.9 sec, 8192 Hz) laughter - Laughter from a crowd (6.4 sec, 8192 Hz) splat - Chirp followed by a splat (1.2 sec, 8192 Hz) train - Train whistle (1.5 sec, 8192 Hz) See also IMAGESCI, IOFUN.
To find the location of a file,
which chirp.mat
/MATLAB/toolbox/matlab/audiovideo/chirp.mat

More Answers (5)

dzid_
dzid_ on 30 Sep 2019

Sean de Wolski
Sean de Wolski on 12 Dec 2014
S(1) = load('gong');
S(2) = load('handel');
sound(S(1).y,S(1).Fs)
sound(S(2).y,S(2).Fs)
And more help: audioread, audiowrite.
  1 Comment
Robert Jenkins
Robert Jenkins on 13 Oct 2022
if you multiply Gong by Handel, and use a bit rate of 10,000 it sounds like a window breaking.
That might make a nice alarm.
S(1) = load('gong');
S(2) = load('handel');
S(3).y = ((S(2).y(1:length(S(1).y),1)).*(S(1).y));
S(3).Fs = 10000;
sound(S(3).y,S(3).Fs)

Sign in to comment.


Chad Greene
Chad Greene on 12 Dec 2014
also load laughter and load train.

Gabriele Bunkheila
Gabriele Bunkheila on 2 Feb 2026 at 8:25
Since its launch in R2016a, Audio Toolbox comes with a collection of sample audio files in a combination of diffferent formats, sample rates, number of channels, and durations.
Try the following:
audiosamplesroot = fullfile(matlabroot,"toolbox","audio","samples");
ls(audiosamplesroot)
Ambiance-16-44p1-mono-12secs.wav Hey-16-mono-6secs.ogg ParametricEqualizer.dll SoftGuitar-44p1_mono-10mins.ogg AudioArray-16-16-4channels-20secs.wav JetAirplane-16-11p025-mono-16secs.wav ParametricEqualizer.vst SpeechDFT-16-8-mono-5secs.wav ChurchImpulseResponse-16-44p1-mono-5secs.wav Laughter-16-8-mono-4secs.wav Rainbow-16-8-mono-114secs.wav TrainWhistle-16-44p1-mono-9secs.wav CleanSpeech-16-mono-3secs.ogg MainStreetOne-16-16-mono-12secs.wav RainbowNoisy-16-8-mono-114secs.wav TrainWhistle-48-mono-2p5sec.opus Click-16-44p1-mono-0.2secs.wav MaleVolumeUp-16-mono-6secs.ogg RandomOscThree-24-96-stereo-13secs.aif Turbine-16-44p1-mono-22secs.wav Counting-16-44p1-mono-15secs.wav multipleSounds-16-16-mono-18secs.wav ReferenceHRTF.mat WashingMachine-16-44p1-stereo-10secs.wav Engine-16-44p1-stereo-20sec.wav MultipleSpeakers-16-8-4channel-5secs.flac ReferenceHRTF.sofa WashingMachine-16-8-mono-1000secs.mp3 FemaleSpeech-16-8-mono-3secs.wav MusicAndSpeech-16-mono-14secs.ogg RockDrums-44p1-stereo-11secs.mp3 WashingMachine-16-8-mono-200secs.mp3 FemaleVolumeUp-16-mono-11secs.ogg NoisySpeech-16-22p5-mono-5secs.wav RockDrums-48-stereo-11secs.mp3 WaveGuideLoopOne-24-96-stereo-10secs.aif FunkyDrums-44p1-stereo-25secs.mp3 NoisySpeech-16-mono-3secs.ogg RockGuitar-16-44p1-stereo-72secs.wav FunkyDrums-48-stereo-25secs.mp3 oscillator.dll RockGuitar-16-96-stereo-72secs.flac Heli_16ch_ACN_SN3D.wav oscillator.vst SingingAMajor-16-mono-18secs.ogg
Get your names into a list
ads = audioDatastore(audiosamplesroot);
aulist = string(ads.Files)
aulist = 39×1 string array
"/MATLAB/toolbox/audio/samples/Ambiance-16-44p1-mono-12secs.wav" "/MATLAB/toolbox/audio/samples/AudioArray-16-16-4channels-20secs.wav" "/MATLAB/toolbox/audio/samples/ChurchImpulseResponse-16-44p1-mono-5secs.wav" "/MATLAB/toolbox/audio/samples/CleanSpeech-16-mono-3secs.ogg" "/MATLAB/toolbox/audio/samples/Click-16-44p1-mono-0.2secs.wav" "/MATLAB/toolbox/audio/samples/Counting-16-44p1-mono-15secs.wav" "/MATLAB/toolbox/audio/samples/Engine-16-44p1-stereo-20sec.wav" "/MATLAB/toolbox/audio/samples/FemaleSpeech-16-8-mono-3secs.wav" "/MATLAB/toolbox/audio/samples/FemaleVolumeUp-16-mono-11secs.ogg" "/MATLAB/toolbox/audio/samples/FunkyDrums-44p1-stereo-25secs.mp3" "/MATLAB/toolbox/audio/samples/FunkyDrums-48-stereo-25secs.mp3" "/MATLAB/toolbox/audio/samples/Heli_16ch_ACN_SN3D.wav" "/MATLAB/toolbox/audio/samples/Hey-16-mono-6secs.ogg" "/MATLAB/toolbox/audio/samples/JetAirplane-16-11p025-mono-16secs.wav" "/MATLAB/toolbox/audio/samples/Laughter-16-8-mono-4secs.wav" "/MATLAB/toolbox/audio/samples/MainStreetOne-16-16-mono-12secs.wav" "/MATLAB/toolbox/audio/samples/MaleVolumeUp-16-mono-6secs.ogg" "/MATLAB/toolbox/audio/samples/MultipleSpeakers-16-8-4channel-5secs.flac" "/MATLAB/toolbox/audio/samples/MusicAndSpeech-16-mono-14secs.ogg" "/MATLAB/toolbox/audio/samples/NoisySpeech-16-22p5-mono-5secs.wav" "/MATLAB/toolbox/audio/samples/NoisySpeech-16-mono-3secs.ogg" "/MATLAB/toolbox/audio/samples/Rainbow-16-8-mono-114secs.wav" "/MATLAB/toolbox/audio/samples/RainbowNoisy-16-8-mono-114secs.wav" "/MATLAB/toolbox/audio/samples/RandomOscThree-24-96-stereo-13secs.aif" "/MATLAB/toolbox/audio/samples/RockDrums-44p1-stereo-11secs.mp3" "/MATLAB/toolbox/audio/samples/RockDrums-48-stereo-11secs.mp3" "/MATLAB/toolbox/audio/samples/RockGuitar-16-44p1-stereo-72secs.wav" "/MATLAB/toolbox/audio/samples/RockGuitar-16-96-stereo-72secs.flac" "/MATLAB/toolbox/audio/samples/SingingAMajor-16-mono-18secs.ogg" "/MATLAB/toolbox/audio/samples/SoftGuitar-44p1_mono-10mins.ogg"
Pick one for inspection
fileId = 1;
Uncomment the following in your MATLAB session for interactive visualization and playback
% audioViewer(aulist(fileId)) %
Or try something more basic
[x, fs] = audioread(aulist(fileId));
t = (1/fs) * (0:length(x)-1);
plot(t,x)
xlim([t(1), t(end)])
xlabel("t (s)")
[~, filename] = fileparts(aulist(fileId));
title(filename)

Image Analyst
Image Analyst on 13 Oct 2022
wavFileList = dir('C:\program files\MATLAB\R2022b\**/*.WAV')
Files Found in: C:\program files\MATLAB\R2022b\examples\deeplearning_shared\data
audio_mix_441.wav keywordTestSignal.wav
clean_speech_signal.wav room_impulse_response.wav
Files Found in: C:\program files\MATLAB\R2022b\examples\matlab\data
handel_audio.wav
Files Found in: C:\program files\MATLAB\R2022b\examples\predmaint_shared\data
bluewhale.wav
Files Found in: C:\program files\MATLAB\R2022b\examples\signal\data
guitartune.wav noisymusic.wav speech_dft.wav
Files Found in: C:\program files\MATLAB\R2022b\mcr\toolbox\comm\comm
rbds_capture_47500.wav
Files Found in: C:\program files\MATLAB\R2022b\toolbox\signal\signal
guitartune.wav

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!