Popular recipes tagged "alarm"http://code.activestate.com/recipes/tags/alarm/popular/2017-05-13T12:12:30-07:00ActiveState Code RecipesA white noise generator to sooth baby to sleep. (Bash)
2017-05-13T12:12:30-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/580801-a-white-noise-generator-to-sooth-baby-to-sleep/
<p style="color: grey">
Bash
recipe 580801
by <a href="/recipes/users/4177147/">Barry Walker</a>
(<a href="/recipes/tags/alarm/">alarm</a>, <a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/baby_alarm/">baby_alarm</a>, <a href="/recipes/tags/cygwin/">cygwin</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/noise/">noise</a>, <a href="/recipes/tags/sleep/">sleep</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/whitenoise/">whitenoise</a>).
</p>
<p>This is a simple BASH, DASH and SH script to sooth a newborn baby to sleep for a laptop with a builtin mic. Develeoped around an Apple MacBook Pro.</p>
<p>Usage:- [./]shush.sh <time in seconds from 18 to 2700> [sensitivity [Hh|Mm|Ll]]<CR></p>
<p>If time is omitted it defaults to 2 bursts of 9 seconds each and if sensitivity is omitted defaults to [M]edium.</p>
<p>It uses Quicktime Player for Apple OSX 10.12.4 minimum /dev/dsp for CygWin and some Linux flavours and arecored for Linux ALSA machines for baby awake detector.</p>
<p>Upon the two arguments the white noise generator runs for approximately the time given in $1 in bursts of 9 seconds until the time limit is reached.
$2 is used to detect of baby is awake and reruns the noise generator again with a new noise waveform.</p>
<p>Enjoy...</p>
A command-line musical alarm clock (Python)
2016-12-30T19:06:32-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580739-a-command-line-musical-alarm-clock/
<p style="color: grey">
Python
recipe 580739
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/alarm/">alarm</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/clock/">clock</a>, <a href="/recipes/tags/multimedia/">multimedia</a>, <a href="/recipes/tags/music/">music</a>, <a href="/recipes/tags/playsound/">playsound</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/time/">time</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>This is a simple musical alarm clock in Python. You pass a command-line argument specifying the time in minutes after which the alarm should go off. When that time arrives, it plays a musical sound.</p>
Simple command-line alarm clock in Python (Python)
2015-10-25T18:27:27-07:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/579117-simple-command-line-alarm-clock-in-python/
<p style="color: grey">
Python
recipe 579117
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/alarm/">alarm</a>, <a href="/recipes/tags/clock/">clock</a>, <a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/time/">time</a>, <a href="/recipes/tags/unix/">unix</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>This recipe shows how to create a simple alarm clock in Python, that can be run from the command line in a terminal. It lets you specify the alarm time in minutes as a command line argument, and prints a wake-up message and beeps a few times, after that time arrives. You can use 0 for the minutes to test it immediately, including to adjust the volume using your speaker controls.</p>
beep based alarm - command line utility (Python)
2014-10-25T22:29:10-07:00Tomas Nordinhttp://code.activestate.com/recipes/users/4189558/http://code.activestate.com/recipes/578953-beep-based-alarm-command-line-utility/
<p style="color: grey">
Python
recipe 578953
by <a href="/recipes/users/4189558/">Tomas Nordin</a>
(<a href="/recipes/tags/alarm/">alarm</a>, <a href="/recipes/tags/argparse/">argparse</a>, <a href="/recipes/tags/beep/">beep</a>, <a href="/recipes/tags/commandline/">commandline</a>).
Revision 2.
</p>
<p>An alarm beeping on you when the eggs are boiled.</p>
Command Line Windows Alarm Clock (Python)
2012-12-05T23:53:49-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578362-command-line-windows-alarm-clock/
<p style="color: grey">
Python
recipe 578362
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/alarm/">alarm</a>, <a href="/recipes/tags/clock/">clock</a>, <a href="/recipes/tags/demonstration/">demonstration</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>Using primitive but simple calculations, the alarm program below will find the offset to the time specified, sleep, and awake to run an alarm until terminated. This Windows recipe utilizes the <code>msvcrt</code> and <code>winsound</code> modules to operate and has limited use elsewhere.</p>
A Crude Baby Alarm For Standard Text Mode Python And Linux. (Python)
2012-08-02T18:05:29-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578232-a-crude-baby-alarm-for-standard-text-mode-python-a/
<p style="color: grey">
Python
recipe 578232
by <a href="/recipes/users/4177147/">Barry Walker</a>
(<a href="/recipes/tags/alarm/">alarm</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/baby_alarm/">baby_alarm</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/sound/">sound</a>).
</p>
<p>This is a simple audio monitor that records about 1/2 second of sound then immediately plays it back in a continuous loop.</p>
<p>If you are testing with a laptop's, (etc), internal microphone be aware that acoustic feedback might occur...</p>
<p>This could be a use for your now aging netbook... ;o)</p>
<p>Bazza, G0LCU...</p>
Custom Windows Alarm Clock (Python)
2012-07-10T17:27:48-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578204-custom-windows-alarm-clock/
<p style="color: grey">
Python
recipe 578204
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/alarm/">alarm</a>, <a href="/recipes/tags/archive/">archive</a>, <a href="/recipes/tags/clock/">clock</a>, <a href="/recipes/tags/old/">old</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>After writing a few alarms using <code>winsound.Beep</code>, desire to expand into other sound possibilities led to the writing of this program using <code>winsound.PlaySound</code>. The sounds are stored in a custom format (some experimentation in archiving files). This is committed for archival to be run under Python 2.5 or later versions.</p>
Queue for managing multiple SIGALRM alarms concurrently (Python)
2012-12-06T18:58:11-08:00Glenn Eychanerhttp://code.activestate.com/recipes/users/4172294/http://code.activestate.com/recipes/577600-queue-for-managing-multiple-sigalrm-alarms-concurr/
<p style="color: grey">
Python
recipe 577600
by <a href="/recipes/users/4172294/">Glenn Eychaner</a>
(<a href="/recipes/tags/alarm/">alarm</a>, <a href="/recipes/tags/queue/">queue</a>, <a href="/recipes/tags/signal/">signal</a>).
Revision 3.
</p>
<p>In asynchronous code, <em>signal.alarm()</em> is extremely useful for setting and handling timeouts and other timed and periodic tasks. It has a major limitation, however, that only one alarm function and alarm time can be set at a time; setting a new alarm disables the previous alarm. This package uses a <em>heapq</em> to maintain a queue of alarm events, allowing multiple alarm functions and alarm times to be set concurrently.</p>