Download mp3 files containing the english pronunciation of a word

One place where you can find those files is dict.leo.org. You can easily play and download the pronunciation of a english word with the following bash script (just copy and save it to filename.sh):

#!/bin/bash

if [ $# -le 0 ]
then
    echo "usage:<script> <word> <word2> <word3> ..."
    exit 1
fi

for i in $*
do;
	mplayer "http://www.leo.org/dict/audio_en/$i.mp3"
	wget "http://www.leo.org/dict/audio_en/$i.mp3"
done

To execute just run something like:

sh /data/Scripts/playanddownloadenglishmp3.sh dangerous

or

sh /data/Scripts/playanddownloadenglishmp3.sh dangerous sign fish noun

 

Leave a comment

Your email address will not be published. Required fields are marked *