LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Tags used in this thread
Popular LQ Tags , , , , , ,

Reply
 
Thread Tools
Old 05-10-2005, 12:01 AM   #1
Soulful93
Member
 
Registered: Dec 2003
Location: Denver, CO
Distribution: SuSE 9.2 Slackware 10.1
Posts: 137
Thanked: 0
Smile ALAC & Lame Script


[Log in to get rid of this advertisement]
I recently installed a ALAC decoder for my Apple Lossless audio file's. I'm using it to decode all of my .m4a file's into a .wav format. Then I'm planning on using Lame to encode all of my .wav files into .mp3 file's.

Still with me... ?

Ok, this is extremely redundant executing the .alac script over and over again and entering song name after song name. I haven't even started with the Lame portion of things yet.

I was wondering if someone could help me out with a script (maybe someone's already thought of this) for this task. I was thinking of something along the lines of pointing the script toward an entire directory and using variables for the song names.

I'm having problem's with the song name portion, I'm not good with variables.

Code:
./alac -f /home/soulful93/Documents/Conversion/example.wav (output) /home/soulful93/Documents/Conversion/example.m4a (input)
Any help or suggestions will be appreciated.
Soulful93 is offline     Reply With Quote
Old 05-10-2005, 02:10 AM   #2
Harmaa Kettu
Member
 
Registered: Apr 2005
Location: Finland
Posts: 196
Thanked: 0
Code:
#!/bin/bash

if [ -d "$1" ]; then
  cd $1
fi

for file in *.m4a; do
  base=`basename $file .m4a`
  /path/to/alac -f $base.wav $file
  lame -h $base.wav $base.mp3
  rm $base.wav
done
Harmaa Kettu is offline     Reply With Quote
Old 05-10-2005, 05:08 PM   #3
Soulful93
Member
 
Registered: Dec 2003
Location: Denver, CO
Distribution: SuSE 9.2 Slackware 10.1
Posts: 137
Thanked: 0

Original Poster
Thank you very much. My finger were starting to get sore for a while there...
Soulful93 is offline     Reply With Quote
Old 06-03-2006, 11:31 AM   #4
lloydsmart
LQ Newbie
 
Registered: Dec 2005
Location: Lewes, UK
Distribution: CLFS x86_64 Pure64
Posts: 29
Thanked: 0
Any way to make this recursive? I have a large iTunes hierachy to convert. Thanks.
lloydsmart is offline  
Tag This Post , , , ,
Reply With Quote
Old 06-03-2006, 12:41 PM   #5
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,253
Thanked: 1
I recently went thru a binge of this sort of thing, and got lots of help, here,... here,... and here.

You may find some of it helpful.
rickh is offline     Reply With Quote
Old 06-03-2006, 04:59 PM   #6
lloydsmart
LQ Newbie
 
Registered: Dec 2005
Location: Lewes, UK
Distribution: CLFS x86_64 Pure64
Posts: 29
Thanked: 0
Thanks for the links, but unfortunately they're no help to me. I don't have a load of numbered files to convert - they all have different names by which they're identified, and they're all in different folders.

The folder hierachy is: ~/iTunes/Artist/Album/Song

Any ideas?
lloydsmart is offline  
Tag This Post , , ,
Reply With Quote
Old 04-15-2009, 08:24 PM   #7
davexthc
LQ Newbie
 
Registered: Apr 2009
Posts: 1
Thanked: 0
Better Alternetive

Use SoundJuicer or banshee to import CDs to FLAC
SoundJuicer ships with ubuntu...Banshee is available here banshee-project.org/

then use SoundKonverter to convert flac to mp3
it has a gui (its a frontend for many encoders such as LAME)
so you can convert multiple files at once
my assumption is that converting alac to flac then to mp3 will cause some serious quality loss
or just rip to mp3 direct from the cd with sound juicer

a good profile for getting hi quality VBR mp3s out of it is :
audio/x-raw-int,rate=44100,channels=2 ! lame name=enc mode=0 vbr=4 vbr-quality=0 vbr-min-bitrate=192 vbr-max-bitrate=320 ! xingmux ! id3v2mux
davexthc is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script: lame stumbles on spaces in filename browny_amiga Linux - General 5 05-14-2008 09:14 AM
Phục hồi dữ liệu bị mất???, cứ pollsite General 1 06-27-2005 01:39 PM
shell script + change shell && continue darkRoom Programming 6 02-25-2005 03:50 AM
Bash script for LAME LocoMojo Linux - Newbie 6 01-09-2005 07:41 PM
Guru = C & Lame = C++ gr33ndata Programming 25 02-22-2004 09:25 AM


All times are GMT -5. The time now is 11:47 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration