Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'flacit and flacmp3 v1.1' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
flacit and flacmp3 v1.1
Authored by: ChrisR on Apr 04, '04 03:37:02AM

I made changes to two of the scripts that I feel are important enough to post here. Below you will find two .diff files. These are used to apply changes to text files and they will save you a lot of time picking through the code. To make the changes to your file simply copy this text into files named "flacit.diff" and "flacmp3.diff" and put them in the directory where the original scripts are stored. Then, in the terminal window, type:


patch flacit flacit.diff
patch flacmp3 flacmp3.diff

Here's the one for flacit. It adds an option to the flac command-line that supresses a warning about the files on the CD not being proper .aiff files.


11a12
>         --force-raw-format \
29a31
>         --force-raw-format \

The changes to flacmp3 are a little more substantial. I modified the lame command-line so that it now does the vorbis comment-to-id3 tag translation in parallel with the actual flac-to-mp3 conversion. This will save you some time on the command line, as now you won't have to run vcid3 after flacmp3 in order to translate the metadata.


3c3
< # flacmp3 - convert a flac file to mp3
---
> # flacmp3 - convert a flac file and its tag data to mp3/id3 format
11c11,25
<       flac -c -d "$file" | lame -h -m s -b 192 - "$(basename "$file" .flac).mp3"
---
>       flac -c -d "$file" |
>         lame -h -m s -b 192 \
>           --tt "$(metaflac --show-vc-field=TITLE "$file" |
>             sed 's/TITLE=\(.*\)/\1/')" \
>           --ta "$(metaflac --show-vc-field=ARTIST "$file" |
>             sed 's/ARTIST=\(.*\)/\1/')" \
>           --tl "$(metaflac --show-vc-field=ALBUM "$file" |
>             sed 's/ALBUM=\(.*\)/\1/')" \
>           --ty "$(metaflac --show-vc-field=DATE "$file" |
>             sed 's/DATE=\(.*\)/\1/')" \
>           --tn "$(metaflac --show-vc-field=TRACKNUMBER "$file" |
>             sed 's/TRACKNUMBER=\(.*\)/\1/')" \
>           --tg "$(metaflac --show-vc-field=GENRE "$file" |
>             sed 's/GENRE=\(.*\)/\1/')" \
>           - "$(basename "$file" .flac).mp3"
13,14c27
<       echo >&2 "No such file: "$1""
<       exit 1
---
>       echo >&2 "No such file: "$file""
18c31
<   echo >&2 "Usage: "$(basename "$0")" INPUTFILE [...]"
---
>   echo >&2 "Usage: "$(basename "$0")" FLACFILE [...]"

Again, I hope you enjoy the scripts. Feel free to email me with any questions.

ChrisR

[ Reply to This | # ]