alarm for finishing running of a program

Hi all
I've written a program and it's so time-consuming. I want to write a command for the programe that alarm me the program runnning has been finished.
How can I do it?
thanks,

1 Comment

I am currently working on a fire detection project after detecting fire it sends mail but my video player or webcam stop working.Please, can anybody know how to solve this problem?

Sign in to comment.

 Accepted Answer

Way too late for an answer here, but my solution for really long running codes was to add this to the end of my long running codes.
load handel
sound(y,Fs)

12 Comments

You are awesome. I'll have it in all my long-running programs. I haven't even tried out beep or other boring stuff. Please somebody to select this answer as the good one to close this question!
Thanx , i just waked up my neighbour and now he angrily knocking on my door :(
Why? He could not Handel the noise? If the sound on your computer is too loud, then the solution is easy. Just lower the sound volume. What actual sound you make is irrelevant.
This really made my day!!!! I will definitely include this in my looping scripts haha
Following this perfect solution, you may love either "gong" or "chirp" and you may play with Fs as well. E.g. I would prefer: load chirp, sound(y,1/2*Fs)
So cool! Where can I see the list of possible sounds?
There are infinitely many possible sounds. A few that have been provided in MATLAB by default are listed by:
>> help audiovideo
Audio and Video support.
Audio input/output objects.
audioplayer - Audio player object.
audiorecorder - Audio recorder object.
Audio hardware drivers.
sound - Play vector as sound.
soundsc - Autoscale and play vector as sound.
Audio file import and export.
audioread - Read audio samples from an audio file.
audiowrite - Write audio samples to an audio file.
audioinfo - Return information about an audio file.
Video file import/export.
VideoReader - Read video frames from a video file.
VideoWriter - Write video frames to a video file.
mmfileinfo - Return information for a multimedia file.
Utilities.
lin2mu - Convert linear signal to mu-law encoding.
mu2lin - Convert mu-law encoding to linear signal.
Example audio data (MAT files).
chirp - Frequency sweeps (1.6 sec, 8192 Hz)
gong - Gong (5.1 sec, 8192 Hz)
handel - Hallelujah chorus (8.9 sec, 8192 Hz)
laughter - Laughter from a crowd (6.4 sec, 8192 Hz)
splat - Chirp followed by a splat (1.2 sec, 8192 Hz)
train - Train whistle (1.5 sec, 8192 Hz)
So train contains a train whistle. Your default choices in MATLAB are chirp, gong, handel, laughter, splat, train. My choice for a long code would be handel, becuase it seems singularly appropriate. However, I suppose the choice for a code that runs a long time, and then fails would best be splat.
You could create your own sound from your own favorite choice. Perhaps the sound of a foghorn you might find posted on the internet.
If you want to avoid loading files:
sound(sin(1:3000));
will give you a plain sinus sound.
Erik Kruit
Erik Kruit on 19 Nov 2021
Edited: Erik Kruit on 19 Nov 2021
Philipp really great!
ah ah ah !!! so funny !

Sign in to comment.

More Answers (3)

A simple way I use to get notified that processing had finished was to add a "beep" to the end of the program (I was usually in the other room watching TV, so it worked for me). Just bear in mind that the beep will either mean your code has finished =) or your code stopped with an error =(.
Edit
At the command line, type:
beep
If you do not hear a sound, type:
beep on
Then test to see if beep works by typing "beep" one more time. If that doesn't work, then make sure your speakers are on loud enough that you can hear it.

4 Comments

dear Elige
as you told, I added "beep" at the end of program, but it doesn't work.
What can I do??
see edit above
thanks for your help. I wrote 'beep on' and also set speakers on high volume, but I didn't hear any voice. my program is as followed:
clc; clear;
T=3 ; M=5 ;
for t=1:T
for i=1:M
for j=1:M
b{t}(i,j)=1/sqrt(2*pi*i)*exp(-1/(2*t)*(j-i)^2);
end
end
end
beep on
What can I do??
"beep on" simply turns on the beep functionality (if it was off). Just in case you have beep turned off elsewhere, your last line should be:
beep on; beep;

Sign in to comment.

Jason Ross
Jason Ross on 27 Jan 2012
Edited: John Kelly on 2 Mar 2015
You could create a function that plays the audio and call it at the end
Or you could have it send you an email at the end of processing:
If you search in the File Exchange for "Alarm" there are other implementations that throw up dialogs, etc.
can anyone help to to get a sound of beep after detecting my face in camera. I have extracted all features my features are recognized I just want a beep sound as the face is detected how can i do that...plz any kind of help will be appreaciated...Thank you

2 Comments

Thank You Sir.I got its solution. I had taken .wav file and I got the beep sound. Thank you Sir for your help.

Sign in to comment.

Tags

Asked:

som
on 27 Jan 2012

Commented:

on 29 Aug 2024

Community Treasure Hunt

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

Start Hunting!