Results 1 to 10 of 10
Im running ubuntu 9.10 and im trying to convert my music i bought off itunes from m4a to mp3. I use Banshee, iv seen a few things saying you can ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-17-2010 #1Just Joined!
- Join Date
- Jan 2010
- Posts
- 80
Convert m4a to mp3 with banshee?
Im running ubuntu 9.10 and im trying to convert my music i bought off itunes from m4a to mp3. I use Banshee, iv seen a few things saying you can do it with mplayer or something like that. Is there a way to do it with banshee?
- 01-18-2010 #2
I don't use banshee, didn't realize it was able to convert media formats. But it's easy enough to do. Fortunately, other people have done all the hard work and written scripts to handle it.
First make sure faad and lame are installed
Then doCode:sudo apt-get install faad lame
Paste the following in gedit and save.Code:gedit ~/m4a2mp3
Make it executableCode:#!/bin/sh # # m4a to mp3 trap 'rm -f "$info" "$opts" "$wav" "$mp3"; exit 10' 1 2 3 15 quality=5 bitrate=192 for m4a in "$@"; do info=` echo "$m4a"|sed -n 's/\.m4a$/.info/p'` opts=` echo "$m4a"|sed -n 's/\.m4a$/.opts/p'` wav=` echo "$m4a"|sed -n 's/\.m4a$/.wav/p'` mp3=` echo "$m4a"|sed -n 's/\.m4a$/.mp3/p'` [ -z "$mp3" ] && continue # study it faad -i "$m4a" 2>"$info" #faad outputs info to stderr! cat "$info" | sed -n ' s/["`$]/\\\&/g # handle any escapes in titles s/^title: \(.*\)$/--tt "\1"/p s/^artist: \(.*\)$/--ta "\1"/p s/^album: \(.*\)$/--tl "\1"/p s/^track: \(.*\)$/--tn "\1"/p s/^date: \([12][0-9][0-9][0-9]\)$/--ty "\1"/p # year? #s/^genre: \(.*\)$/--tg "\1"/p # m4a genres dont match those of mp3 ' - > "$opts" # convert it faad "$m4a" eval "lame -q $quality -b $bitrate "`cat "$opts"`" \"$wav\" \"$mp3\"" # cleanup rm -f "$opts" "$wav" "$info" done
You may want to put it in a directory in your $PATH.Code:sudo chmod +x ~/m4a2mp3
Put the files you want to convert in a directory, open the terminal to said directory, and typeCode:sudo cp ~/m4a2mp3 /usr/bin
Code:m4a2mp3
- 01-18-2010 #3Just Joined!
- Join Date
- Jan 2010
- Posts
- 80
- 01-19-2010 #4Just Joined!
- Join Date
- Jan 2010
- Posts
- 80
Ok, the first command turns out this:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package fadd
im already sutck. Im not quite sure what this error message is caused by?
- 01-19-2010 #5faad, you have faddE: Couldn't find package fadd
- 01-19-2010 #6Just Joined!
- Join Date
- Jan 2010
- Posts
- 80
Wow, I'm not really that stupid! I promise lol.
It worked.
Another question, are there any programs or utilitys that will search my drive and point me to a certain file type. Like say I wanted to see the name and location of every m4a file on my hard drive, or even just in a certain dir.
- 01-19-2010 #7
For a GUI search tool, I think Ubuntu uses Beagle by default.
Probably one of the more powerful search tools in the find command. Basic usage isSo you might doCode:find [path] [options]
You can also execute a command on files found, such as your conversion script.Code:find /home/username -name '*.mp3'
I don't have need of these tools much, so I'm not well versed in all their capabilities.Code:find /home/username -name '*.m4a' -exec m4a2mp3 '{}' \;
https://help.ubuntu.com/community/FindingFiles
How-To: Find files on your computer with find | Debian/Ubuntu Tips & Tricks
Unix/Linux "find" Command Tutorial
- 01-20-2010 #8Just Joined!
- Join Date
- Jan 2010
- Posts
- 80
alright great that worked perfect.
the only problem now is that i have many files in many different directories that i need to convert. There is no way to convert all audio files in a directory to mp3 is there? like if i point it to my /hom/user/Music dir, could it convert everythingin there to mp3? or atleast try?
EDIT: also having problems as what you had posted to convert is not converting. I am trying to convert aac(aka m4a) files to mp3. After typing in the m4a2mp3 command while in the artest directory and it returns nothing. It just jumps down to the next line and is ready for another command. The files are still .m4a.
- 01-20-2010 #9
Sorry, you need to specify the files you want to convert.
Something like
To target all files in the current directory ending in .m4a.Code:m4a2mp3 *.m4a
- 01-21-2010 #10Just Joined!
- Join Date
- Jan 2010
- Posts
- 80
ok, after that it looked like it was going to work. I cd'd to my itunes music dir and entered the command and got this:
For this to work do i have to cd to the actual folder that the files are in i am wanting to convert? Like if i cd to ~/Music/iTunes Music , and enter the command it will not work? Do i have to be in ~/Music/iTunes Music/artest/album then enter the command? im unsure exactly what one is right.Code:*********** Ahead Software MPEG-4 AAC Decoder V2.6 ****************** Build: Oct 8 2008 Copyright 2002-2004: Ahead Software AG http://www.audiocoding.com Floating point version This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License. ************************************************************************** Error opening file: *.m4a Could not find "*.wav".


Reply With Quote

