Shell Script For Converting Between Different Audio Formats

All the media players do not support all audio formats. For this, we may need to convert from one format to another. The following step describe how we can do this, and is applicable to almost all formats.

Using Mencoder

Check out my post at Conversion From One Audio Format To Another Using Mencoder. If this doesn't help, you can follow the steps given below.

Using Shell Script

1. Open the terminal, and type,


varsha@varsha-laptop:~$ cd ~/.gnome2/nautilus-scripts

2. Open a new script,

varsha@varsha-laptop:~/.gnome2/nautilus-scripts$ gedit convert\ any\ to\ mp3.sh

3. Type the following code in the file.

mplayer -ao pcm "$1" -ao pcm:file=temp.wav
OUTNAME="${1%%.wma}.mp3"
lame -b 128 temp.wav "$OUTNAME"
rm temp.wav


4. Comment out rm temp.wav if you do not want to remove the temporary file temp.wav, by prepending the line with a #. So,

#rm temp.wav

5. Save the file and close the editor.

6. To convert any file to mp3, right-click the file and select Scripts-> convert any to mp3.sh.



Comments

  1. iomoio is an Open Source community resource dedicated to helping open source projects be as successful as possible. We thrive on community collaboration to help us create a premiere resource for open source software development and distribution.

    ReplyDelete
  2. fantastic articles and enormous format. Your blog claim merits the whole unmarried one of the certain feedback its been getting. online audio converter

    ReplyDelete
  3. · Sangean WR-11 Review, Wood Cabinet AM/FM Table Top Analog Radio. melissa July 19, 2018 Analog Radio No Comments. In today’s world new forms of entertainment are coming up to grab our attention every now and then sangean wr-11 vs tivoli model one

    ReplyDelete

Post a Comment