Utilizing Off Time in Internet Radio

By abhishek

No one likes a silence when tuning to a radio station, and for a radio manager its tough to have 24*7 programmes, in case you are running an Internet Radio Station using Airtime you probably would be programming your shows and in Offtime your radio is always silent i would suggest you to play some random tracks in this Offtime and also include a track which tells when your station plays live so here is how to achieve this

  1. Put some MP3 files in a folder of your server, please also record a message with the showtimings etc or what ever you want this folder may contain any number of files which you want to play in off time (Folder used in the below script /store00/rand)
  2. Edit /usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq (below is the patch) the modified lines are in bold

@@ -150,14 +150,14 @@
 #                "read_stop_all",
 #                fun (s) -> begin log("dynamic_source.read_stop") destroy_dynamic_source_all() end)

-default = amplify(id="silence_src", 0.00001, noise())
+#default = amplify(id="silence_src", 0.00001, noise())
 ref_off_air_meta = ref off_air_meta
 if !ref_off_air_meta == "" then
     ref_off_air_meta := "Airtime - offline"
 end
-default = rewrite_metadata([("title", !ref_off_air_meta)], default)
-ignore(output.dummy(default, fallible=true))
-
+#default = rewrite_metadata([("title", !ref_off_air_meta)], default)
+#ignore(output.dummy(default, fallible=true))
+default = playlist(mode='random', "/store00/rand/")
 master_dj_enabled = ref false
 live_dj_enabled = ref false
 scheduled_play_enabled = ref false

Once you have modifed you are good to go restart the services, upon restarting you will listem random tracks in offtime from the folder you have set in the script.

Tested on Airtime 2.5.1, do listem to VMOU's stream @ http://vmou.ac.in/stream

Resize Multiple Images

By abhishek

I am sure you would have come to a situation when you would have to resize multiple images say you copied 200 images from your Digital Camera and now need to upload them and need to resize them all, now doing this using GIMP would take ages here is a easy way.

Step 1) Install ImageMagick

sudo apt-get install imagemagick

Step 2) Change to the Directory where all Images are Present

Step 3)

a) If you need to reduce images to a specific Percentage

mogrify -resize 20% -format jpg *

b) If you need to reduce to Specific Width & Height

mogrify -resize 800x600 -format jpg *

c) If you need to reduce to Specific Width

mogrify -resize 1024x -format jpg *

Further Reading Click Here !!!