Set up alarm with fade-in, for graceful awakening

at 8:30 <<<'mpc volume 20; mpc play; for i in `seq 1 16`; do sleep 2; mpc volume +5; done'
There are a lot of commands, which invokes your player at specified time. But I prefer not to jump from by bed, when alarm start to play. Instead, this script increases volume of mpd over time, which much more pleasant when you just woke up :)

7
By: mechmind
2011-11-30 17:51:27

These Might Interest You

  • fade [type] fade-in-length [stop-time [fade-out-length]] Apply a fade effect to the beginning, end, or both of the audio. An optional type can be specified to select the shape of the fade curve: q for quarter of a sine wave, h for half a sine wave, t for linear (`triangular') slope, l for logarithmic, and p for inverted parabola. The default is logarithmic. A fade-in starts from the first sample and ramps the signal level from 0 to full volume over fade-in-length sec? onds. Specify 0 seconds if no fade-in is wanted. For fade-outs, the audio will be truncated at stop-time and the signal level will be ramped from full volume down to 0 starting at fade-out-length seconds before the stop-time. If fade-out-length is not specified, it defaults to the same value as fade-in-length. No fade-out is performed if stop-time is not specified. If the file length can be determined from the input file header and length-changing effects are not in effect, then 0 may be specified for stop-time to indicate the usual case of a fade-out that ends at the end of the input audio stream. All times can be specified in either periods of time or sample counts. To specify time periods use the format hh:mm:ss.frac format. To specify using sample counts, specify the number of samples and append the letter `s' to the sample count (for example `8000s').


    1
    sox input.mp3 output.mp3 fade h 5 00:02:58 5
    kev · 2011-09-03 13:59:03 0

  • 0
    alarm() { perl -e 'alarm shift; exec @ARGV' "$@"; }; alarm 20 foo arg1
    fnds · 2013-08-26 19:40:55 0
  • Set an alarm to starts in specific time. Show Sample Output


    8
    echo "aplay path/to/song" |at [time]
    brausen · 2009-06-25 19:33:37 2
  • Grab the multiline webhook URL definition from alarm-show. Basically it parse the following into an URL only: ```root@ctl01:/home/hombre# ceilometer alarm-show 1383a6be-fb73-4955-9991-8d65a8a23d60 +---------------------------+--------------------------------------------------------------------------+ | Property | Value | +---------------------------+--------------------------------------------------------------------------+ | alarm_actions | [u'http://10.40.50.20:8000/v1/signal/arn%3Aopenstack%3Aheat%3A%3A3d6118 | | | cc789c4db3b06fb3a382494b67%3Astacks%2Fhombre-V2R1%2Fd189e704-4f99-467 | | | 5-9ec2-eaadkc0ae8af5%2Fresources%2Fweb_server_scaleup_policy?Timestamp=20 | | | 16-10-03T14%3A05%3A27Z&SignatureMethod=HmacSHA256&AWSAccessKeyId=09sdkd4e | | | d854347189383aba11d6353c6&SignatureVersion=2&Signature=MXxlKLZ%2BT4y4y%2 | | | BOuuAmxTLIVQ9ONKx2jKSZKHYIy83Q%3D'] | ```


    0
    curl -X POST -i `ceilometer alarm-show 1383a6be-fb73-4955-9991-8d65a8a23d60 | tr '\n' ' ' | sed -e 's/.*\[\(.*\)\].*/\1/' -e 's/[| ]*//g' -e 's/^u//' -e "s:'::g"`
    epcim · 2016-10-03 15:15:21 0

What Others Think

genius!
linuxrawkstar · 341 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: