So I decided my cell phone was too harsh an alarm clock to wake up by and wrote a script to make my netbook take on the task. Currently, the script puts the netbook to sleep after setting the RTC to wake it up again and upon waking slowly fades in music from my collection and then goes into a cycle of fading out the music, speaking the time and fading the music in again.
I strongly believe it should have more features, problem is I don't know what else to have it do. Anyone have any ideas?
I tried piping some TRex quotes from Dinosaur Comics through it, but a lot was lost in the text-to-speech translation. Maybe some 'fortune' quotes would work better.
Anyone else here using a computer as a primary alarm clock? How's that working out for you? I really like mine so far.
My alarm clock talks, now what?
That is awesome. I want to wake up to TRex quotes!
I got sick of my phone alarm and my clock/buzzer, so I'm currently using a radio alarm tuned in to a Italian/German/Filipino news radio station (I find voices less harsh than alarms/music, but don't want to wake up to the day's news in a language I understand ;))
I got sick of my phone alarm and my clock/buzzer, so I'm currently using a radio alarm tuned in to a Italian/German/Filipino news radio station (I find voices less harsh than alarms/music, but don't want to wake up to the day's news in a language I understand ;))
. 22 Racing Series .
I'm curious how you did this. Can please elaborate?
How do you set the RTC to wake up a computer at a certain time? What OS are you using?
How do you set the RTC to wake up a computer at a certain time? What OS are you using?
I woke up to my buzzer sounding PDA better than my ringing SONY alarm clock (which can also play radio as wake up call). I guess I need some annoying sound to my ear than some music / quotes / radio show that might cause me to keep sleeping like a baby.
Does PDA running WM 6.1 consider as a PC? It already have the best thing that I want - play wav / mp3 as sound, and provide me with the buzzer sounding that really irritate the ear, thus wakes me up.
Does PDA running WM 6.1 consider as a PC? It already have the best thing that I want - play wav / mp3 as sound, and provide me with the buzzer sounding that really irritate the ear, thus wakes me up.
It is I, the spectaculous Don Karnage! My bloodthirsty horde is on an intercept course with you. We will be shooting you and looting you in precisely... Ten minutes. Felicitations!
Hmm, an interesting topic of discussion. I've actually been thinking about getting a proper alarm clock, but it seems to me that there really isn't anything on the market that is what I want. The crazy expensive/fancy Sony one comes close, and so does the Chumby, but I have never seen either for sale in Canada.
I think the alarm clock is a pretty simple device that is ripe for someone to come along and shake things up. Imagine an alarm clock that slowly lightens the room when it is time to wake up (either by a built in lamp or by using something like x10 to turn the room lights on). Also, something that displays the morning news, email, etc. would be pretty sweet (if not displaying email, at least displaying an indicator of how many new messages you have). It'd have to be a decent size - maybe a 7" display or so with a fairly well built case to prevent from accidentally being knocked over or hit in your early morning hazy stumblings around the room.
So, does such a thing actually exist?
To the op: How about having it show a count of new emails you have, as well as a simple RSS reader?
I think the alarm clock is a pretty simple device that is ripe for someone to come along and shake things up. Imagine an alarm clock that slowly lightens the room when it is time to wake up (either by a built in lamp or by using something like x10 to turn the room lights on). Also, something that displays the morning news, email, etc. would be pretty sweet (if not displaying email, at least displaying an indicator of how many new messages you have). It'd have to be a decent size - maybe a 7" display or so with a fairly well built case to prevent from accidentally being knocked over or hit in your early morning hazy stumblings around the room.
So, does such a thing actually exist?
To the op: How about having it show a count of new emails you have, as well as a simple RSS reader?
How about one that shoots a laser beam to your forehead and says "Nuclear launch detected?"
Moe, what did you mean by expensive Sony?
Mine is RM 80, which is around USD 25. The reason I bought this is I'm tired of RM 10 alarm clocks, which don't even last 6 month. The reason is that they mechinically cheap and have too much tiny parts.
This one is digital alarm clock + radio in one. It great at having a 'sleep' button. pressing this will swithc on the radio for one hour I think (I listen to Light n Easy, a Malaysian radio show), which is good.
I remember there are other Sony alarm clock types, but this one is good enough for me.
Mine is RM 80, which is around USD 25. The reason I bought this is I'm tired of RM 10 alarm clocks, which don't even last 6 month. The reason is that they mechinically cheap and have too much tiny parts.
This one is digital alarm clock + radio in one. It great at having a 'sleep' button. pressing this will swithc on the radio for one hour I think (I listen to Light n Easy, a Malaysian radio show), which is good.
I remember there are other Sony alarm clock types, but this one is good enough for me.
Quote: Original post by Moe
I think the alarm clock is a pretty simple device that is ripe for someone to come along and shake things up. Imagine an alarm clock that slowly lightens the room when it is time to wake up (either by a built in lamp or by using something like x10 to turn the room lights on). Also, something that displays the morning news, email, etc. would be pretty sweet (if not displaying email, at least displaying an indicator of how many new messages you have).
Both already exist. Philips makes alarm clocks that slowly light up he room. A Chumby can wake you while displaying twitter feeds, e-mail, of even hypnotoad.
Personally I don't care for fancy alarms. I even banished my digital alarm clock. I need a real jolt to wake up. I bought one of them classic old fashioned alarm clocks with two big bells on top with a hammer in between. The only difference is that this one runs on a battery instead of a spring (no annoying ticking!). It wakes me much better than any fancy digital alarm.
<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>
Quote: Original post by shurcool
I'm curious how you did this. Can please elaborate?
How do you set the RTC to wake up a computer at a certain time? What OS are you using?
I'm running Linux, where you can echo a date into a system file, like so:
echo `date '+%s' -d '0800'` > /sys/class/rtc/rtc0/wakealarm
Once that is set, the computer will power-on or wake up at the given time, which I think is completely awesome for being so easy to do.
Quote: Original post by alnite
How about one that shoots a laser beam to your forehead and says "Nuclear launch detected?"
I'm looking for less harsh alarms, not heart-attack inducing ones ;)
I like the email count idea. I'll have to play with that one. I'd want my work email counts, which will probably be non-trivial since they run an outlook server behind a firewall and only let a webclient out. Hooray screen-scraping!
For the curious, here's the code for the alarm clock.
Some warnings and assumptions:
- No warranty! This works for me, YMMV
- Written in Ruby (Mostly between 2AM and 4AM when I should've been sleeping)
- Uses the 'Trollop' command line option parsing library (easy to get as Ruby gem)
- Runs on Linux (Arch in my case, though others should work)
- Assumes your RTC is like mine (probably safe for modern computers)
- Assumes you use PulseAudio
- Assumes you use mplayer with the -ao pulse option compiled in
- Assumes a 'say' command that speaks its argument is in your path (I'll post mine)
- Assumes the program is run in a directory next to a file 'playlist' which lists paths to music files, one file per line
- Assumes you have the 'shuf' program installed
- Probably some other stuff specific to my system that I forgot
#!/bin/env rubyrequire 'trollop'def fade(id, time, from, to) #Fades pulse source given by id from 'from' percent to 'to' percent over 'time' in seconds steps = (time / 0.05).ceil d = (to - from) / steps.to_f td = time / steps.to_f steps.times do |i| sleep(td) set_volume(id, from + (d * (i+1))) endenddef set_volume(id, percent) #Given a pulse source id, sets volume of source to percent of max #puts "pacmd set-sink-input-volume #{id} #{(percent / 100.0 * 65535).floor}" `pacmd set-sink-input-volume #{id} #{(percent / 100.0 * 65535).floor}`enddef id_of(pid) #Looks up pulse source id from pid sink_inputs = `pacmd list-sink-inputs` id = nil sink_inputs.lines.each do |l| id = l.split(":")[1].strip.to_i if l.strip.start_with?('index') if( l.strip.start_with?('application.process.id') ) if l.split("=")[1].strip.delete('"').to_i == pid return id end end end return nilenddef start_mplayer(arg) # Starts mplayer with pulse output and volume normalization + args, returns pid mplayer_cmd = "mplayer -ao pulse -af volnorm " # (pid = fork) ? Process.detach(pid) : exec(mplayer_cmd + arg) exec(mplayer_cmd + arg) unless (pid = fork) return pidenddef say_time(volume, date_string='now', word='donk', word2=nil) # Runs date_string through 'date' command, forms a sentence to say the date in 24hr format, and 'say's it # volume is not used currently # 0000 - midnight # 0001 - oh oh oh 1 # 0015 - oh oh 15 # 0700 - oh seven hundred # 1100 - eleven hundred # 1101 - eleven oh one time = `date '+%H%M' -d '#{date_string}'`.strip word2 = word unless word2 oh = 'oh[[_:_]] ' say = '' if time == '' say = 'royaly screwed' elsif time == '0000' say = 'midnight' else if time[0] == '0' say = oh if time[1] == '0' say += oh else say += time[1] end else say = time[0..1] end say += ' ' if time[2] == '0' if time[3] == '0' say += 'hundred' else say += oh + time[3] end else say += time[2..3] end end `say "[[_:_:_:_:]]At the sound of the #{word}, the time will be #{say} .[[_:_:_:_:]] #{word2}."` ## 'say' command handles this now (in largely the same way) # `espeak -a 200 -k 20 -s 140 -v mb-en1 -z "[[_:_:_:_:]]At the sound of the #{word}, the time will be #{say} .[[_:_:_:_:]] #{word2}." | mbrola -e /usr/share/mbrola/en1/en1 - time.wav` # `sox --norm time.wav timenorm.wav` # `paplay --volume=#{(volume / 100.0 * 65535).floor} timenorm.wav`endopts = Trollop::options do version "alarm 0.0.2 (c) 2010 Joel Hough" banner <<-EOSUsage: alarm [options] <date> where <date> is a string suitable for the 'date' commandAn awesome alarm that suspends, plays music, and talks!EOS opt :music_volume, "Music volume (percent of max)", :default => 40 opt :quiet_music_volume, "Music volume during voice (percent of max)", :default => 20 ## 'say' command doesn't support this yet #opt :speech_volume, "Speech volume (percent of max)", :default => 90 opt :word, "At the sound of the <word>...", :default => "donk" opt :word2, "... <word2>", :type => String opt :dry_run, "No suspend, shorter timers. For testing speech, music, and volume", :short => "n" opt :clock, "Make clock say this time. For testing clock vocalization edge cases, mainly", :default => 'now'endunless opts[:dry_run] Trollop::die "must specify a date" unless ARGV[0] time = `date '+%s' -d "#{ARGV[0]}"`.strip #Seconds since epoch Trollop::die "must specify a valid date" if time == '' `sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"` #Clear the RTC (setting it twice before triggered causes access violations) `sudo sh -c "echo '#{time}' > /sys/class/rtc/rtc0/wakealarm"` puts `head -n 4 /proc/driver/rtc` #Should display current date/time and alarm date/time sleep 10 `sudo pm-suspend` #Sleepy time!end`shuf playlist > newlist`music_pid = start_mplayer('-playlist newlist')music_id = niluntil music_id = id_of(music_pid) #Slight delay before pulse source shows up sleep 0.1endtime_to_fade_in = 60time_between_clock = 60 * 5if opts[:dry_run] time_to_fade_in = 5 time_between_clock = 10endfade(music_id, time_to_fade_in, 5, opts[:music_volume])loop do fade(id_of(music_pid), 2, opts[:music_volume], opts[:quiet_music_volume]) say_time(opts[:speech_volume], opts[:clock], opts[:word], opts[:word2]) sleep 0.5 fade(id_of(music_pid), 2, opts[:quiet_music_volume], opts[:music_volume]) sleep time_between_clockend
And my say command:
Warnings:
- Also in Ruby
- Uses espeak+mbrola (en1 voice)
- Uses sox for normalization
#!/usr/bin/env rubyrequire 'tmpdir'Dir.mktmpdir 'say' do |p| file = File.join(p, 'speak.wav') filenorm = File.join(p, 'speaknorm.wav') `espeak -a 200 -k 20 -s 140 -v mb-en1 -z "#{ARGV[0]}" | mbrola -e /usr/share/mbrola/en1/en1 - #{file}` `sox --norm #{file} #{filenorm}` `paplay --volume=65535 #{filenorm}`end
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement