sound will not play Mac Matlab 2018b
Ältere Kommentare anzeigen
Hi there, I am working through a brilliant Udeny course in Matlab and am currently working on generating a sound but am finding that this session does not work, even though I have written exactly as specified (I think!)
frequencies = 5000; % Hz
duration = 1; % duration of the sound
amplitude = 1; % loudness
fs = 44100; % Sampling rate
T = 1 / fs ; % Time sampling period
t = 0:T:duration; % time vector
signal = amplitude * cos(2 * pi * frequencies * t);
sound(signal, fs)
Can anyone tell me where I'm going wrong please?
9 Kommentare
Walter Roberson
am 16 Feb. 2020
It works for me on my Mac; it also works for me if I run it on MATLAB online.
I could make the general advice about making sure that your speaker is not muted, and that the volume is sufficient.
As an experiment, try
load handel
sound(y, Fs)
Ajay Pattassery
am 19 Feb. 2020
Bearbeitet: Ajay Pattassery
am 19 Feb. 2020
As suggetsed above, try the following code.
load chirp.mat
sound(y, Fs)
If you are still not hearing the sound, then it is nothing to do with the code you wrote.
Anyways, I do not see any problem in your code.
Make sure there are no environmental issues outside MATLAB by playing any audio file on your pc.
Please respond if you are still facing the issue.
Tracey Rochester
am 19 Feb. 2020
Tracey Rochester
am 19 Feb. 2020
Walter Roberson
am 19 Feb. 2020
Ah, it would have helped to have that earlier. You need to rename or delete that file as it is interfering with playing sound.
Tracey Rochester
am 19 Feb. 2020
Walter Roberson
am 19 Feb. 2020
I suspect that you still have another sound.m
which -all sound
Walter Roberson
am 19 Feb. 2020
MATLAB Online is at
http://matlab.mathworks.com
Not all licenses have access to that, but current student licences do.
Tracey Rochester
am 20 Feb. 2020
Akzeptierte Antwort
Weitere Antworten (1)
Tracey Rochester
am 19 Feb. 2020
0 Stimmen
Kategorien
Mehr zu Code Generation and Deployment finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


