Archive for July, 2006

Skype Voicemail Script

July 23, 2006

I’ve written a script that will allow you to use voicemail on Skype 1.3 (using ALSA on Linux) for free. It checks whether or not you’re in a call, and, if you are, it’ll try to divert your speakers/headphones to your microphone. It will then play a voicemail message of your choice (use a sound recorder or speech synthesiser or something) named vmail.wav. Then the person at the other end will be able to make a 20-second voicemail message, which will be saved as msg<ISO 8601 date and time>.wav. Copy it to a text file, save it and set it as executable.

#!/bin/sh

while [ 1 ]
do
while [ “$incall” = “” ]
do
incall=`lsof | grep ‘skype.*pcm’`
sleep 3

done
time=`date -Iminutes`
amixer -c 0 cset numid=20 5
aplay vmail.wav
arecord -d 20 -f cd msg$time.wav
amixer -c 0 cset numid=20 0
incall=`lsof | grep ‘skype.*pcm’`
while [ “$incall” != “” ]
do
incall=`lsof | grep ‘skype.*pcm’`
done
done

In order for this to work for you, you may need to set the two amixer lines. Here’s how. Firstly, type

amixer contents

Look for a line that looks something like:

numid=20,iface=MIXER,name=’Capture Source’

The numid may not be 20. Note down the numid. Also, note down the options below this line, which look something like this:

; Item #0 ‘Mic’
; Item #1 ‘CD’
; Item #2 ‘Video’
; Item #3 ‘Aux’
; Item #4 ‘Line’
; Item #5 ‘Mix’
; Item #6 ‘Mix Mono’
; Item #7 ‘Phone’

This option is normally set to Mic. You want to set it to Mix. If there isn’t a Mix, then there may be a Mix Mono. If there isn’t either, paste the output of your ‘amixer contents’ into a comment and I’ll try to help. Note down the item number of Mix and Mic.

Your first amixer command will be changed to:

amixer -c 0 cset numid=<your ‘Capture Source’ numid> <the ID of ‘Mix’>

The second will be:

amixer -c 0 cset numid=<your ‘Capture Source’ numid> <the ID of ‘Mic’>

The script should then work; if it doesn’t, feel free to ask for help.

Many moons have passed since I last posted here

July 22, 2006

But I’m not dead, you might be happy to know.

School’s over for another year, so I have 6 weeks of doing bugger all ahead of me. Just the way I like it.

KuruKuru2X isn’t dead either, my map guy has gone on holiday, that’s all. I’ve done a highscore table, and am in the process of doing credits. Stay tuned.

I’m going on holiday too on the 29th, so he’d better be back by then.