フィルターのクリア

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))
  1 件のコメント
bo hyeoun lee
bo hyeoun lee 2019 年 12 月 9 日
ok i wii try thak u!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by