Batch MP3 conversion (foobar2000 recommended)

Source: Internet
Author: User
Document directory

Yesterday, the project needed to convert a batch of WAV Files into MP3 files to reduce the size of the installation package.

 

First, I wrote a tool myself. The waveform control of our company had some problems with the processing of the recorded WAV file, and finally gave up.

 

I searched for a circle and found the advanced MP3 converter Chinese version. I didn't expect to install a Trojan, So I downloaded the 4.03 English version. Fortunately, it is easy to find the registration code online. Unfortunately, MP3 files cannot be output to the same directory as WAV Files, but only to the specified directory. My WAV folder contains many subdirectories and many files with the same name, in addition, this small shared software is not very confident in compatibility and stability.

 

So please come out with the name "Cool Edit Pro". Others are good, that is, it is too troublesome to add files. You cannot add directories, but you can only select files to add files. So many subdirectories are exhausted one by one, in addition, his conversion speed is not satisfactory. Every time he opens, he has to make out the waveform and then convert it.

 

Then you can enable the pause listener, which can also be converted to MP3. For example, you can right-click the selected file, but unfortunately, it cannot be output to the same WAV directory.

 

 

 

Finally, foobar2000 is used, and the operation is the same as the quiet listening. This time, it can be output to the same directory:

 

 

The corresponding dialog box is displayed. The encoding format can be customized. I select the default 24 k MP3 file, which meets the requirements. However, I want the output file name to be the same as WAV, but the extension is different, the default setting does not meet the requirements, so the output file name is changed to % filename %.

 

 

 

For the tag formats of foobar2000, refer to the following article:

 

Translation from foobar2000 Chinese fans

Title formatting syntax reference

Common Fields

Syntax Explanation
% Title % Audio Track title. If the metadata "title" does not exist, use the file name instead.
% Artist % Artist name. Check the following metadata fields in sequence: "artist", "album artist", "Composer", and "timer ".
% Album artist % Album artist name. Check the following metadata fields in sequence: "album artist", "artist", "Composer", and "timer ". Unlike % artist %, % album artist % is used when there are different artists in the entire album.
% Track artist % Audio Track artist name. Valid only when % album artist % is different from % artist %. Used with % album
Artist % used together to specify different artists in the album, for example: "% album artist %-% title % ['//' % track
Artist %] "; in this case, the last part of the content is only displayed when an artist specified by the audio track exists.
% Album % Album name. Check the following metadata fields in sequence: "album" and "venue ".
% Date % . Use the metadata "date" field.
% Genre % Genre, which uses the metadata "genre" field.
% Tracknumber % Audio Track number. Valid only when the metadata "tracknumber" field exists.
% Totaltracks % Total audio tracks. Valid only when the metadata "totaltracks" field exists.
% Discnumber % Cd id. Valid only when the metadata "discnumber" or "disc" field exists.
% Totaldiscs % Total CDs. Valid only when the metadata "totaldiscs" field exists.
% Codec % The name of the encoding format. If you cannot obtain the correct encoding format effectively, use the File suffix.
% Codec_profile % The additional information about encoding settings is not always valid.
% Filename % File Name, excluding suffix names and directories
% Filename_ext % File name, including the suffix but not the directory.
% Directoryname % File directory name.
% PATH % File Path. Use % path_sort % instead of % PATH % for sorting.
% Subsong % The audio track number in the file, which is used for the file format (such as Chapter and cue) that a single file supports multiple audio tracks ).
% Path_sort % Combined with the file path of the audio track number, it is used for sorting; the return value is uncertain, so it should not rely on its return value.
% Length % Length, in the format of [hh:] mm: Ss.
% Length_seconds % Length, in seconds. The format is an integer.
% Bitrate % Bit Rate, measured in kilobytes per second (Kbps). Dynamic VBR bit rate is supported.
% Channels % Number of sound channels (Mono/stereo/etc ).
% Samplerate % Sampling Rate, in Hz.

The above list is not complete, and some less important fields such as % field %, metadata and % __field %, and technical information ing are used to maintain backward compatibility.

 

Function

Syntax Explanation Example
$ Abbr (X) Returns the abbreviation of X. $ Abbr (% album %)
$ Abbr (x, y) If the length of X is not greater than Y, the abbreviation of X is returned. Otherwise, X is returned. $ Abbr (% album %, 5)
$ Lower (x), $ upper (X) Converts X to lowercase or uppercase. $ Upper (% title %)
$ Num (x, y) The number X is displayed and 0 is added before it so that the length is not less than Y (used for audio track numbers, etc ). $ Num (% tracknumber %, 3)
$ Caps (X) Convert the first letter of all words into uppercase letters, and all other letters into lowercase letters, for example, "blah "? "Blah ". $ Caps (% title %)
$ Caps2 (X) It is similar to $ caps, but does not change the uppercase letters, for example, "blah "? "Blah ". $ Caps2 (% title %)
$ If (x, y, z) If X contains at least one valid field, execute/display y; otherwise execute/display Z. $ If (% artist %, % artist %, unknown artist)
$ If2 (x, y) It is the same as $ if (x, x, y.  
$ If3 (X, Y, Z ,..) Returns the parameter that contains at least one valid field.  
$ Ifgreater (A, B, C, D) If the number A is greater than B, execute/return C; otherwise execute/return D.  
$ Iflonger (A, B, C, D) If string a is longer than string B, execute/return C; otherwise execute/return D.  
$ Longest (a, B, c ,....) Compare strings a, B, c ,... Returns the string with the maximum length. $ Longest (% title %, % filename %
$ Len (X) Returns the length of string X.  
$ Pad (x, y), $ pad_right (x, y) Fill in spaces before/after string X so that the length is not less than Y.  
$ Pad (x, y, z), $ pad_right (x, y, z) Make sure that the length of the character Z before/after string X is not less than Y.  
$ Cut (x, y) Truncates X to set the length to y.  
$ Padcut (x, y), $ padcut_right (x, y) Fill in spaces before/after string X, and cut the result so that the length is not greater than Y.  
$ Insert (A, B, n) Insert string B to string a after n characters.  
$ Add (x, y), $ sub (x, y), $ MUL (x, y), $ Div (x, y), $ Mod (x, y ), $ min (x, y), $ max (x, y) Mathematical operations: addition, subtraction, multiplication, division, modulus, minimum, and maximum values.  
$ Left (x, y) Returns the y characters in the header of string X.  
$ Right (x, y) Returns the last y characters of string X.  
$ And (x, y), $ or (x, y), $ XOR (x, y), $ not (X) Logical operators: And, Or, XOR, and non. Used for collaboration with $ if.  
$ Fix_eol (x), $ fix_eol (x, y)

Extract multiple strings and add "(…)" at the end of the string "(...)" (First version) or Y (second version ).

 
$ (X) Returns the value of X in the metadata field. $ (Artist)
$ _ SEP (x, y), $ _ SEP (x, y, z) Return the value in the metadata field X. In the case of multiple values, add a custom separator. $ (Artist, 'and ')? "Artist1, artist2 and artist3"
$ _ Num (X) Returns the number of values in value x of the metadata field.
$ Info (X) Returns the technical information named X. $ Info (bitrate)
$ Char (X) Insert Unicode characters numbered X. $ Char (9674)
$ Strcmp (x, y)

If the string x and y return "1" at the same time, otherwise, an empty string is returned for use with $ if.

 
$ Stricmp (x, y) $ Strcmp (X, Y) is case-insensitive.  
$ Directory (x), $ directory (x, n) Extract the directory name from file path X. The additional options specify to extract the Top N directory names. $ Directory (% PATH %, 2)
$ Greater (x, y)

Compare two integers to check whether x> Y is used together with $ if () and logical operators.

 

$ Longer (x, y) compares two strings and checks whether X is longer than Y. It is used with $ if () and logic
Operator.
$ Strchr (x, y) searches for the position where the character y in string X first appears.
$ Strrchr (x, y) searches for the final position of character y in string X.
$ Strstr (x, y) searches for the first position in string y in string X.
$ Progress (A, B, C, D, E) creates a progress bar. (Version 1)
$ Progress (% playback_time_seconds %, % length_seconds %, 20, '#', '= ')?
"====#======================="
$ Progress2 (A, B, C, D, E) creates a progress bar. (Version 2)
$ Progress2 (% playback_time_seconds %, % length %, 20, '#', '= ')?
"######===================="
$ Select (n, a, B, c ,....) Returns the nth parameter from a, B, c.
$ Repeat (x, n) repeats x n times.
$ Replace (a, B, c) replaces all string B in string a with string C.
$ Ext (x) extracts the Suffix from the file name/path X. $ Ext (% PATH %)
$ Substr (a, B, c) returns the substring of,
From character B to character C. $ Substr (blah, 1, 2 )? "BL"
$ RGB (), $ RGB (R, G, B), $ RGB (R, G, B, RS, GS, BS) to generate color code. The parameters are integers ranging from 0 to 255, representing red,
Green and Blue components. The default color is returned for versions without parameters. Versions with six parameters
This allows you to define the color of the selected text (reversed by default ). Warning:
$ RGB () cannot be used for plain text processing functions, and its results are uncertain. $ RGB (255, 0, 0) ASDF $ RGB ()? "ASDF"
$ Transition (A, B, C) inserts gradient in string. Gradient the text color from B to C. $ Transition (% title %, $ RGB (255,255,255), $ RGB (, 0 ))
$ Blend (A, B, C, D) generates a mixed color between A and B. The score C/D is used as the mixing condition. $ Blend ($ RGB (255,255,255, 0), $ RGB (50,100)
$ Trim (a) removes leading/trailing white spaces from string. $ Trim (% title %)
$ Tab () generates a tab, equivalent to $ char (9 ). Refer to the "tab" below for detailed information. $ Tab ()
$ Stripprefix (x) removes the prefixes "A" and "the" from X. $ Strippefix (% artist % )? "The prodigy" is changed to "prodigy"
$ Stripprefix (x, prefix1, prefix2 ,...) Removes the specified prefix from X. $ Stripprefix (% artist %, A, )? "The prodigy" is changed to "prodigy"
$ Swapprefix (x) moves the prefix "A" and "the" to the end of X. $ Swapprefix (% artist % )? "The prodigy" is changed to "prodigy,"
$ Swapprefix (x, prefix1, prefix2 ,...) Move the specified prefix to the end of X. $ Swapprefix (% artist %, A, )? "The prodigy" is changed to "prodigy,"
$ Year (time) returns "year" from the time/date string in the format of 4 digits ). $ Year (% last_modified %)
$ Month (time) returns "month" from the time/date string in the format of two digits ). $ Month (% last_modified %)
$ Day_of_month (time) returns the day of the month from the time/date string in the format of 2 digits ). $ Day_of_month (% last_modified %)
$ Date (time) Gets Date information from the time/date string in the format of YYYY-MM-DD ). $ Date (% last_modified %)
$ Time (time) obtains time information from the time/date string in the format of HH: mm: SS or hh: Mm ). $ Time (% last_modified %)

Variable operations

  • Variables allow you to immediately save text processing results to reduce redundant formatting of text.
  • Variables cannot be exchanged among multiple running instances and the actual file information cannot be modified.
  • The function of a variable is to shorten the size of a script that is too complex, rather than other functions.
Syntax Explanation Example
$ Put (name, text) Set the value of the variable named name to text and return text. "$ Put (x, blah)" sets the variable X to "blah" and returns "blah ".
$ Puts (name, text) The silent version of $ put. It works the same as $ put (name, text), but returns an empty string.  
$ Get (name) Returns the value named name. If the variable does not exist, an empty string is returned. "$ Puts (x, blah) $ get (x)" returns "blahblah"
Others

Syntax Explanation Example
[.... ] If the field does not contain a reference, all content in square brackets is discarded. It is mainly used to create a formatting script that is only valid for related fields. % Artist %-[% album %/] % title %
'(Single quotes) Insert specified text to ignore syntax processing; special characters such as "%", "$", "[", and "]" are allowed. To insert single quotes in the text, you can use ''(two single quotes ).  
// The comment can only be used at the beginning of a line. The text after the comment is not parsed from the beginning to the end of a line.  
EOL characters Ignore; you can split your script into multiple rows to improve readability without affecting the results.  
Tab) Alignment is used to align specific context text, such as the status bar. See: $ tab () % Title % $ tab () % length %

 

Context Field

Syntax Explanation
% List_index % ID of the list where the project is located. Applies to: playlist, list of projects processed by masstagger/massrenamer, and so on. Add 0 before the result to accommodate the largest number of digits in the list.
% List_total % Specifies the total number of projects in the project list. Applied to: playlist, list processed by masstagger/massrenamer, and so on.
% Isplaying % It is valid if the current project is playing. For example, a playlist item is playing. Used for conditions in $ if.
% Ispaused % Valid if the current project is playing and paused. For example, a playlist item has been paused. Used for conditions in $ if.
% Playback_time % The current playback time in the format of [hh:] mm: Ss. Valid only in some places where the playing context information is used, such as the status bar.
% Playback_time_seconds % Current playback time, in seconds. The format is an integer. Valid only in some places where the playing context information is used, such as the status bar.
% Playback_time_remaining % The remaining playback time in the format of [hh:] mm: Ss. Valid only in some places where the playing context information is used, such as the status bar. If the current Playing Track does not have a duration, the error message is invalid.
% Playback_time_remaining_seconds % The remaining playback time, in seconds. The format is an integer. Valid only in some places where the playing context information is used, such as the status bar. If the current Playing Track does not have a duration, the error message is invalid.
% Queue_index % ID of the queue in which the project resides. this parameter is only valid for the playlist.
% Queue_indexes % ID list of the queue in which the project is located, which is only valid for the playlist. It is equivalent to % queue_index % if the specified project appears only once in the queue.
% Queue_total % Total number of projects in the queue. Technically, this field is only valid for audio tracks in the queue.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.