To emit a simple sound each time a video is labeled
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Max Murphy
el 8 de Dic. de 2019
Editada: Max Murphy
el 8 de Dic. de 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))
Ver también
Categorías
Más información sobre Audio and Video Data en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!