필터 지우기
필터 지우기

To emit a simple sound each time a video is labeled

조회 수: 2 (최근 30일)
bo hyeoun lee
bo hyeoun lee 2019년 12월 8일
댓글: bo hyeoun lee 2019년 12월 9일
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.

답변 (1개)

Max Murphy
Max Murphy 2019년 12월 8일
편집: Max Murphy 2019년 12월 8일
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))

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by