How do I find built in sounds?
Afficher commentaires plus anciens
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 commentaire
Chad Greene
le 15 Déc 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.
Réponse acceptée
Plus de réponses (5)
dzid_
le 30 Sep 2019
xpsound

Sean de Wolski
le 12 Déc 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 commentaire
Robert Jenkins
le 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)
Chad Greene
le 12 Déc 2014
2 votes
also load laughter and load train.
1 commentaire
Sean de Wolski
le 15 Déc 2014
Nice!
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)
Get your names into a list
ads = audioDatastore(audiosamplesroot);
aulist = string(ads.Files)
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
le 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
Catégories
En savoir plus sur Audio and Video Data dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
