LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Anyone knows about AAC to MP3 converter (https://www.linuxquestions.org/questions/linux-software-2/anyone-knows-about-aac-to-mp3-converter-299455/)

switcher 03-09-2005 12:31 AM

Anyone knows about AAC to MP3 converter
 
HI I do have a problem with the aac plugin for xmms and is causing me huge pain in the butt when I try to use it with gtkpod.

Everytime I try to play the file the thing will go to sleep as freezing while playing the file you can still hear the music but the player just hangs and I have to force quit sooo I have three questions.

1 Does anyone know how to fix it so I can use as it is?

2 If not is there any way to substitute xmms there for video lan client which is playing everything I throw at it and IMHO is much better player for audio video dvd awesome app btw. I could not find the script syntax for it so it just opens and you have to manually open the file and look though the Ipod directory structure in which the files are scattered so you have no idea wher it is makin the gtkpod useless.

3 I am not picky about the format so if I can solve it by changing my music to MP3 I dont care so I would need advice on a nice aac to mp3 converter for Linux

I would appreciate any help you guys can provide on each one of the questions.
Thanks

Engmar 03-09-2005 08:30 AM

You could use dir2ogg [link here] (if your AAC's are .m4a's from iTunes) to convert them to ogg if you have no luck with your other options.

jong357 04-12-2005 01:57 PM

m4a2mp3
Code:

#!/bin/sh
#
# m4a to wav to mp3

for i in *.m4a; do
    faad "$i"
    x=`echo "$i"|sed -e 's/.m4a/.wav/'`
    y=`echo "$i"|sed -e 's/.m4a/.mp3/'`
    lame -h -b 192 "$x" "$y"
    # Comment the line below if you want to keep the .wav files
    rm "$x"
done

Obviously, you need faad2 and lame installed.

While I'm at it... ;)

m4a2wav
Code:

#!/bin/sh
#
# m4a to wav

for i in *.m4a; do
    faad "$i"
done

You need faad for that one

mp32wav
Code:

#!/bin/sh
#
# mp3 to wav
#
# This script will encode ALL .mp3's in the working
# directory to .wav format. No need to pass any arguments.
# Especially usefull for preparing a group of files
# to be burned to an audio CD.

for i in *.mp3; do
    echo "$i"
    tgt=$(echo "$i" | sed -e "s/mp3/wav/")
    mpg123 -b 10000 -s -r 44100 "$i" | sox -t raw -r 44100 -s -w -c2 - "$tgt"
done

You need mpg123 and sox for that one

wma2mp3
Code:

#!/bin/bash
#

#############################################################
# Move the conversion process into a function that can
# be called.
# The "&&" makes it so each step must be successful before
# the next step will be done.
#############################################################
function wma2mp3 () {
  if [ ! -f "$1" ]; then
    echo "File $1 not found!"
  else
    mplayer -ao pcm -aofile "${1%%.[Ww][Mm][Aa]}.wav" "$1" &&
    lame -h -b 192 "${1%%.[Ww][Mm][Aa]}.wav" "${1%%.[Ww][Mm][Aa]}.mp3" &&
    rm -f "${1%%.[Ww][Mm][Aa]}.wav" ||
    echo "There was a problem with the conversion process!"
  fi
}

#############################################################
# Not enough information to compute
#############################################################
if [ $# -lt 1 ]; then
  echo
  echo "Usage:  wma2mp3 myfile.wma"
  echo "        wma2mp3 myfile.wma myfile2.wma myfile3.wma"
  echo '        wma2mp3 "my file with spaces in the name.wma"'
  echo '        wma2mp3 "file with spaces 1.wma" "file with spaces 2.wma"'
  echo '        wma2mp3 "*.wma"'
  echo "        wma2mp3 /directory/containing/wma/files"
  echo
  exit
fi

#############################################################
# Directory was passed so convert all wma files in directory
#############################################################
if [ $# -eq 1 -a -d "$1" ]; then
  for file in $1/*.[Ww][Mm][Aa]
  do
    wma2mp3 "$file"
  done
  exit
fi

#############################################################
# One or more wma files were passed, convert them
#############################################################
for file in $*
do
  wma2mp3 "$file"
done

exit

EDIT: That one is all screwed up. I fixed it on the wiki tho...

You need mplayer and lame for that one. Notice above that you HAVE to name that script "wma2mp3"....

That opens up some options using one or more in tandem.... I still need to clean up some of that. I got burned out on this awhile ago. They all work tho. Just the usage needs to be tweaked...

Actually, If I'm not mistaken, faad2 comes with an XMMS plugin that works flawlessly with .m4a's... I think it's faad2... Been awhile...

bulliver 05-02-2005 01:06 PM

jong357:

You should add your scripts to the LQ wiki...
Conversion between audio formats is a common question here.

jong357 05-05-2005 02:34 PM

Done.. Not a bad idea I suppose. I think I got them in the right place.. ;)

http://wiki.linuxquestions.org/wiki/...a_applications

I labeled it "Audio Conversion"


All times are GMT -5. The time now is 03:00 PM.