To emit a simple sound each time a video is labeled
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hi
I want to make sound whenever the title is attached to the figure video.
camera = VideoReader('slow.mp4');
nnet = alexnet; % Load the neural net
pic = image([]);
while hasFrame(camera)
picture = readFrame(camera); % Take a picture
picture = imresize(picture,[227,227]); % Resize the picture
label = classify(nnet, picture); % Classify the picture
pic.CData = picture; % Show the picture
title(char(label)); % Show the label
if title(char(label))
beep on
if else title(char(label))
beep off
end
drawnow limitrate;
end
delete(camera);
I've changed the source code but it doesn't work.
Not only does it not sound, but it also happens that the video stops.
I want to make a sound whenever the label is attached to the video.
It's the source code I changed.
0 Commenti
Risposte (1)
Max Murphy
il 8 Dic 2019
Modificato: Max Murphy
il 8 Dic 2019
To produce the dreaded error sound, syntax is just beep; (beep on or off just toggles whether the error sound is on or muted).
Depending on the current state of your Matlab environment due to use of beep off, you may need to make a single call to the command window before running your code:
beep on; % Ensures it is toggled to "on" state
Your code will not run because the second conditional statement syntax should be
else
not
if else title(char(label))
Vedere anche
Categorie
Scopri di più su Audio and Video Data in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!