0

I want to convert a set of flac files to aac using best resolution for aac file .

I found this tool audio convert but I am missing the man page or a help side. The command works when I use

audio-convert <filename>.flac

but it starts some graphical choice wizard. Is there a way to only use one terminal command so I can batch it over a set files?

1

I believe this is not the best tool to do the conversion from the command-line, it is not designed to be used this way.

This tool depends on zenity(which shows the graphical part) and processes files one-by-one, this is an excerpt from the README file provided by the tool

to use it as a plain bash script, provided you have access to an x session and have zenity installed, simply type: path/to/audio-convert path/to/filename... and specify as many filenames as you want. they will be processed one by one, just as it happens when you select multiple files on nautilus or rox.

I would suggest that you use the tools used by the script you mentioned, which is faac for AAC encoding, but you will have to decode FLAC files first, using flac.

For details about calling faac and flac from the terminal, you can look up online documentation, you will find many examples as they are commonly used, and you can also check the functions aac_encode() and flac_decode() in the script audio-convert:

flac_decode ()
{
    temp_file=`echo "$1" | sed 's/\.\w*$/'.wav'/'`
    flac -d "$1" -o "$temp_file" 2>&1 | awk -vRS='\r' -F':' '!/done/{gsub(/ /,"");gsub(/% complete/,"");if(NR>1)print $2; fflush();}' | zenity --progress --title="$title" --text="$2 $1" --auto-close
}

and

aac_encode ()
{
    if [ $fields -eq 0 ] || [ $pass_metatags -eq 0 ]
        then
                aac_parse_fields
        faac -w "${aac_fields[@]}" -q $quality -o "$3" "$2" 2>&1 | awk -vRS='\r' '(NR>1){gsub(/%/," ");print $3; fflush();}' | zenity --progress --title="$title" --text="$conversion $1" --auto-close
    else
        faac -q $quality -o "$3" "$2" 2>&1 | awk -vRS='\r' '(NR>1){gsub(/%/," ");print $3; fflush();}' | zenity --progress --title="$title" --text="$conversion $1" --auto-close
    fi
}

but keep in mind you can't use them as is from audio-convert because they depend on other variables defined in the file.

| improve this answer | |
  • Thanks for the tip. Do you have a specific command to convert flac to aac with faac – A.Dumas Jun 21 '19 at 12:29
  • The commands are faac and flac, I added a bit more info in the comment. – Diaa Sami Jun 21 '19 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.