MP3 Book Helper FREE SOLUTION

MP3 Book Helper provides rapid Mp3 (ID3v1, ID3v2) and Ogg/Speex/Flac Vorbis tags editing and file renaming functions. Mass Tag editing is done using special variables and Regular Expressions. Undo and preview for all changes, capitalization, search and replace, use parts of file name or directory structure for tags. Directory renaming and restructure based on tags. All customizable and configurable. Get the artist and album information from the freedb database over internet. Play your mp3 files in Winamp or internal player while editing Tags. It will auto pause and resume Winamp when renaming or updating files. It can also be used to easily create WinAmp-compatible playlists (M3U files), Information (NFO) files, Parity archive (PAR) data recovery files, Simple File Verify (SFV) and Sound Verification (.SV) checksum files. You can export and import ID3 tags to and from XML and comma delimited text files, verify CRC/MD5 checksums and more. It was designed for managing audiobooks but could be used for any mp3 and ogg files.

Supported Operating Systems: Windows 95, 98, Me, 2000 or XP

Features:

- Batch and manual editing of Vorbis, ID3v1.1 and ID3v2.3 tags
- Batch renaming of MP3/Ogg/Speex/Flac files. Ability to construct file names using sequential numbering and ID3/Vorbis tags
- Import Tag information from FreeDB
- Multi-level Undo for tag changes and file renaming
- Fast test for completeness and correct size of sound files based on information from SFV, MD5 SV and PAR/P?? checksum files
- Simultaneous tests of CRC32 (for SFV) MD5 (for PAR) SV (MP3 Audio Only) checksums for MP3, OGG files
- Play mp3 files in Internal Player or Winamp. Auto Pause and Resume when renaming or updating files.
- Creation of the Parity archive (PAR) data recovery files
- Generation of the WinAmp-compatible playlists (M3U files)
- Generation of the .SFV .MD5 and .SV Checksum files
- Generation of the text file with information about the audiobook/album, i.e. an NFO file. Using predefined format or Template files
- Drag & Drop support for opening files
- Support MP3, Ogg, Speex and Flac audio files formats
- Unicode File names in language other than English on Windows XP and 2000
- Unicode ID3v2 and Ogg tags fully supported on Windows XP and 2000
- Preview mode in bulk tags editing and renaming
- Selectable style of variables for renaming and taging $B, or
- If you made a mistake you are able to "Undo file rename" or Tag changes
- Persistence of the recently used Masks and other data in .ini file
- Mask builder, Custom variables and presets
- Ability to convert ID3v1.1 to ID3v2.3 tags for all files with one click
- Swap tag fields with one click
- Replace symbols or Regular expressions and change capitalization in Tags and File names
- File name to Tag extraction using Regular expressions or predefined variables
- Export/Import ID3/Ogg tags and file names to XML or CSV (Comma - Separated - Values) text files.
- MP3 ID3v2 embedded image (Cover art) editing
- MP3 ID3v2 and OGG Lyrics editing
- Support other than basic ID3v2 text frames in "batch edit" TIT1, USLT, TEXT and so on.
- TSIZ ID3v2-Tag support, tests if MP3 file size match described in this ID3v2 tag.
- Duplicates MP3 database is base on Audio Only Checksum
- Useful filter in file view: 'Loaded', 'Loaded and Missing', 'Missing Only', 'Corrupted only', 'Duplicates only'
- Keep tested files database (file .sfvt) to avoid double testing of MD5 (.MD5 or .PAR) and CRC (.SVF) checksums
- In file view show if file was truncated or has extra data in comparison to information from PAR/SFV
- WinAmp control allow to jump to last 10, 20, 30 seconds of file for quick spot testing of recording
- Internal text editor for NFO files also could start external text/.nfo editor for created NFO files
- Could Open all mp3/ogg files from selected folder(s)
- Could Rename/Move currently selected folder
 

Editing tags manually one by one

To edit the tags of one file manually use tab 'Tags single file' or double-clicking on a file row or select 'Edit file tag' from menu 'Tags'. New form would be opened and you would be able to rename file or change selected in main form tags ID3v1 or ID3v2.

'Save' changes of selected file and move to next or previous file in list if options in 'Save and:' selected.

'Save' button is [Enter] on keyboard.

'Cancel' command will not save tags for the last file and will close this window.

You could move to any file without changes using arrow buttons or using 'File#' dropdown.

If you made a mistake you are able to undo changes you made to last N files, N defaults to 10 and could be changed in Options.

Tag editing mode allow you to set 1 and 2 version of ID3 at the same time.

1&2 mode:
  • Shows v1 tags and if empty show v2
  • On Save sets v1 and then copy to v2
2&1 mode:
  • Shows v2 tags and if empty show v1
  • On Save sets v2 and then copy to v1. In this case v1 could be trimmed as the result and different from tag v2

Batch tags editing

Select the files to edit using "File - Select Files" or drag-and-drop from Windows Explorer (anywhere onto the form), bring all the files for a book into the program.

Click the tab labeled "Tags" near the top left of the screen to select the tag editing tabsheet.

Sort your files in order you want them to be played (enumerated). Click on column header to sort by this column. Column header icon indicates state of last sort operation: Normal, Smart and Reverse Sort. By default loaded files are sorted by name. If you file names have a numbers greater then 9 and there are no 0 in front for decade then your files may be sorted incorrectly by player and Mp3BookHelper. Use 'Smart sort file names' in this case "file 2.mp3" would be before "file 10.mp3". Also it is possible to change order of the files moving them manually. Use drag and drop for individual files or Ctrl Up/Down to move selected files in file list.

Use the "Select Tag" combo box to pick which tag you want to edit (i.e., replace), and enter the new tag value or Variables in the edit box below it. If you don>t want to type you could construct mask from variables using context menu or Mask help window.

To apply changes to files press the "Set for All" button. NOTE: There's no confirmation - the tags get set when you push that button. "Preview" button allows you to preview tags and file name changes for all files before actually applying this changes to files. [F2] and [Enter] on Keyboard also set currently selected tags. [Enter] works differently depending on the cursor position, preview label show what would be set: [AT] - All Tags, [OT] - One selected tag.

There are two sets of buttons "Preview" and "Set for All". Second row is enabled when "View/Edit all tags" is checked and will set all selected Tags not only the one selected in "Select Tag" combo box. Masks that use ID3 Tag variables ($A, $B.) will produce different strings for setting all tags and only one tag.

"Current mask yields" shows result for currently selected tag and in braces number of characters in this tag. Result depends on current cursor position in "Multiple Tags" ([AT] All) frame or in "Selected tag" edit box ([OT] One).

No changes are made to unchecked files in file list. Use file selection menu or popup menu to change which files you want to modify. By default all files are selected for modifications.

Use Variables to extract tag from file name.

Order in which multiple tags are set is following: Album, Artist, Track#, Year, Genre, Comment, Track Title, File Renamed. So if you use <Year> in Mask for Album name original value from file would be used, to solve this change year first using set one tag.

Keep in mind that in ID3v1 tags mode you are limited to a maximum number of characters for each tag field: Title, Artist and Album - max. 30 characters, Year - max. 4 characters, Comment - max. 28 characters.

If you made a mistake you are able to Undo each Tag Set operation you made.

Tag Editing Variables

To set ID3 tags and File name you can use special variables to make these tags more useful and easy to set. If input filed in program supports masks you would be able to insert variables to this masks using popup context menu for this filed.

Variable names are matched case sensitively fist, and if not found insensitively. '\' is escape character before variable use <\> or \\ To make single \ before variable.

Predefined variables types:

Variable Class Variables
Tag values $A <Artist> <Author> $B <Book> <Album> $T <Title>
$K <Track#> $k <track#> $G <Genre> $Y <Year> $C <Comment>
<Composer> <Encoder> <Copyright> <URL> <Tag ID3v2FRameName>
$. <Self> <This>
Derived from Tag values $2 ${2B} <2Book> <2Album> ${2A} <2Author> <2Artist> $4 ${4AB} <4AB>
Special fields $R <ReadBy> $S <Series> $s <Series#> $U <Abridged> <AbridgedUA> <AbrUnabr> <Abr>
File and folder names $F <File> <FileExt> $D <Folder> <Directory> $P <Path> <PFolder> <PDirectory> <PPFolder> <PPDirectory>
Counters $I <Count> $i <count> <Count01> $L <Count0> $l <count0>
$N <Total> $0 <XXX>
$J <CountTape> <TapeCount> <TotalTape> <TapeTotal> <XXT>
<CheckedCount> <checkedcount> <CheckedTotal>
$#I <CountF> $#N <TotalF> $#F <FoldersCount>
Mp3 info <EncBr> <EncHz> <EncMode> <EncKHz> <EncVBR> <FileSize> <FileSizeKb> <FileSizeB> <FileSizeMB> <Duration> <DurationMin> <DurationSec> <DurationSecMSec> <DurationHHMM> <DurationHHMMSS>
Other <FileCRC> <Char Number>
Directives <SR#> <SL#>
<CU> <CL> <CC> <CA>
<R><what><with> <r><what><with> <ri><what><with> <IF><what><then><else> <IFE><what><then>
<F><spec> <FD><spec>
<X><what> <XS><skip><what> <XE><what><skip>
<FileItem><number><expression> <FileList><expression>
<FlagFile><dos_mask> <TextFile><file_name>
<T><rus2lat> <T><lat2rus> <T><file_name>
<Rnd><#>
<Expr><expression>

 

Available predefined variables:

$T - Track Name (ID3 Tag)

Synonym: <Title>

$B - Album / Book Name (ID3 Tag)

Synonyms: <Album>, <Book>

$A - Author / Artist (ID3 Tag)

Synonyms: <Artist>, <Author>

$K - Track number (ID3 Tag)

Synonym: <Track#>

$k - Track number (ID3 Tag)($K) Not formatted, Not zero tabbed

Synonym: <track#>

$G - Genre (ID3 Tag)

Synonym: <Genre>

$Y - Year (ID3 Tag)

Synonym: <Year>

$C - Comment (ID3 Tag), COMMENT from Ogg

Synonym: <Comment>

$2 - 2 chars from Album (Book Title)

Synonyms: ${2B}, <2Book>, <2Album>

Example: Title 'Fellowship of the Ring' produce 'FR'

$4 - 4 chars from Author and Title;

Synonyms: ${4AB}, <4AB>

Example: Author, Title 'JRR Tolkien', 'Fellowship of the Ring' produce 'JTFR'

${2A} - 2 chars from Author

Synonyms: <2Author>, <2Artist>

Example: Author 'JRR Tolkien' produce 'JT'

$. - Original value of tag or name you are modifying

Synonym: <Self>, <This>

$R - Read By Not ID3 tag, this is just variable you enter manually,

Defaults for it extracted from comments in tags that contains anything

resembling read by, narrator and variations and

read from existing NFO files

Synonym: <ReadBy>

$S - Series Name Not ID3 tag, this is just variable you enter manually.

Synonym: <Series>

$s - Series Position Not ID3 tag, this is just variable you enter manually.

Synonym: <Series#>

$U - Abridged, This value you enter manually,

default for it extracted from NFO

Synonym: <Abridged>

<AbridgedUA>, <AbrUnabr>, <Abr> - Constructed base on <Abridged>

$I - Track counter (formatted enumeration of loaded files starts from 1)

Files are numbered by the order they appear is the file list.

If you have less then 10 files ($N) it would create numbers 1, 2, 3. See <Count01>

If you have 10 to 99 files it would create numbers 01, 02, 03 .

If you have 100 to 999 files it would create numbers 001, 002, 003 .

Synonym: <Count>

$i - Track counter (starts from 1), $I not zero tabbed

Synonym: <count>

$N - Number of files total (counts only loaded to program files)

Synonym: <Total>

$L - Track counter (starts from 0)

Synonym: <Count0>

$l - Track counter (starts from 0), $L not zero tabbed

Synonym: <count0>

$0 - Fill the same size as counter using 0 or see options

Synonym: <XXX>

$J - Tape Files counter (starts from 1A or 01A then 1B, 2A.)

Synonym: <CountTape> <TapeCount>

<TotalTape> - Number of Tapes (total of files divided by 2)

Synonym: <TapeTotal>

<XXT> - Fill the same size as <TapeCount> using 0 or see options

<CheckedCount> - Checked Files counter (starts from 1)

<checkedcount> - Checked Files counter (starts from 1), not zero tabbed

<CheckedTotal> - Total Number of Checked files

$F - File Name

Synonym: <File>

<FileExt> - File Name extension .mp3 or .ogg

$D - Folder Name

Synonyms: <Folder>, <Directory>

Also <PFolder>, <PDirectory>, <PPFolder> and <PPDirectory> Could be used for Parent Folder Name and Parent of Parent folders names

$P - Full Folder Path

Synonym: <Path>

$#I - Files counter in folder (only loaded to program)

Synonym: <CountF>

$#i - Files counter in folder, $#I not zero tabbed

Synonym: <countf>

$#L - Files counter in folder (starts from 0)

Synonym: <CountF0>

$#l - Files counter in folder (starts from 0), $#L not zero tabbed

Synonym: <countf0>

$#N - Total number of files in folder

Synonym: <TotalF>

$#0 - Fill the same size as <CounterF> using 0 or see $0

Synonym: <XXF>

$#F - Folder number (enumeration of folders starts from 1)

Synonym: <FoldersCount>

$#f - Folder number, not zero tabbed

Synonym: <folderscount>

$#T - Total number of opened folders

Synonym: <FoldersTotal>

<Composer> - Composer from ID3v2, Performer from Ogg

<Encoder> - Encoder from ID3v2 and Ogg

<Copyright> - Copyright from ID3v2 and Ogg

<URL> - Link from ID3v2 , Location from Ogg

<Tag ID3v2FRameName> - Get ID3v2 text frame: TIT1, TBPM and so on..

Example: <Tag TIT1>; Will get content group <Tag TALB>; Will get album for Vorbis or ID3 tags

<Tag VobisTagName> - Get Vorbis text frame

Example: <Tag ALBUM>; Will get album for Vorbis tags

<FileCRC> - Name of first SFV or PAR that contains the file

<Char Number> - Get special ASCII character Tab, CR and so on..

Number could be in decimal or hex format

Example: <Char 9> will create TAB character

<Char 0xa9> will create © symbol

Advance variable useful for NFO generation:

<EncBr> <EncHz> <EncMode> <EncKHz> <EncVBR>

<FileSize> <FileSizeKb> <FileSizeB> <FileSizeMB>

<Duration> <DurationMin> <DurationSec> <DurationHHMM> <DurationHHMMSS>

<FD><mm' Min' ss' Sec'><DurationSec>

<FD><c' milliseconds'><DurationSecMSec>

There are 57 predefined variables now, if you want more you are able to define your own custom variables in "Mask help" window.

In "Mask help" window there are "Mask builder" tab is to help you in typing variables. In mask builder you could Drag and Drop variables to the list "Mask as list". The list is itemized representation of the mask string "Mask as text". You could move each variable up or down using Mouse you. Result of mask builder is one string (mask). When you created this string you could add it to preset and use in future.

String Format and Extract directives.

Use these directives before a variable to affect only that variable and then characters between variable and the directive, or as the last directive to affect the complete result. Grouping variables using [[ ]] brackets is allowed. Nesting groups can only be done using Custom variables.

<SR#> or <SL#> - String Format Left or Right justified, where # is width of the resulting string for next Variable.

Example: <SR40>(<Album>) or <SL30><Album>

<CU> <CL> <CC> <CA> - Case change and capitalize directives

<CU> - UPPER CASE

<CL> - lower case

<CC> - Capitalize first word

<CA> - Capitalize All Words

<UM> - Un-merge directive,

Insert spaces before Capital letter only after Lower Case or -,_;'`~"

Example: WwwTorontoON.CA<UM> -> Www Toronto ON.CA

<R><what><with> - Replace directives, support Regular Expressions

"what" could be Regular Expression.

"with" could contain other variables.

References to matching expression could be made using RegEx backreferences \0 \1 ... \9 or $& $1 . $9 for substitution. $0, $2, $4 are Mp3BH variables so escape should be used (use \$0 $1 \$2 ... $8 $9). \0 \1 through \9 are translated to $0, $1... $9 before execution so you could use any of this for substitutions.

<r><what><with> - Replace directives, No regular Expressions,

<ri><what><with> - Replace directives, Ignore case, No regexp,

Example: <File><R>< ><_> would replace all spaces with underscore.

<R><^.{4}><>$F would remove first 4 characters from file name

<R><^The (.*)><\1, The>$F would match 'The Any thing' and returns 'Any thing, The'.

<R><^(\w+)\s*(\w+)><\2 \1>$A Should reverse the first and last name.

How Do I replace the second underscore by a space?

$F<r><_>< ><R><^([^ ]*) ><\1_> or 

$F<r><_>< ><R><^(.*?) ><\1_> would take '01_Any_thing' and returns '01_Any thing'.

<IF><what><then><else> - Returns "then" when "what" results in not empty

string. If No variables set in "what" or result is empty string returns "else".

"What", "then", "else" could be any variables expression.

For nested if you will need to define custom variables

Example: <IF><$S><$A><$B>

If $S = MySeries then it gives Author

If $S Empty then it gives Album

<IFE><what><then> - Returns "what",

If No variables set in "what" or result is empty string returns "then"

Example: $A<IFE>< - $S - >< - >$B

If $S = MySeriesthen it gives Author - MySeries - Album

If $S Empty then it gives Author - Album

Example2: <IFE><<X><FindMe>$S><NotFound>

If $S = FindMe then it gives: FindMe

If $S = FindHim then it gives: NotFound

<F><spec> - Format directive, [%][-][width][.prec]type

Example: <F><.2d><Count> -> 01

Format specifiers have the following form:

[%][-][width][.prec]type

A format specifier begins with a % character. After the % come the following, in this order:

An optional left justification indicator, ["-"]

An optional width specifier, [width]

An optional precision specifier, ["." prec]

The conversion type character, type: d, u, x, f, g, n or s

The following table summarizes the possible values for type:

bDecimal. The argument must be an integer value. The value is converted to a string of decimal digits. If the format string contains a precision specifier, it indicates that the resulting string must contain at least the specified number of digits; if the value has less digits, the resulting string is left-padded with zeros.

uUnsigned decimal. Similar to 'd' but no sign is output.

xHexadecimal. The argument must be an integer value. The value is converted to a string of hexadecimal digits. If the format string contains a precision specifier, it indicates that the resulting string must contain at least the specified number of digits; if the value has fewer digits, the resulting string is left-padded with zeros.

sString. The argument must be a character, a string value. The string or character is inserted in place of the format specifier. The precision specifier, if present in the format string, specifies the maximum length of the resulting string. If the argument is a string that is longer than this maximum, the string is truncated.

fFixed. The argument must be a floating-point value. The value is converted to a string of the form "-ddd.ddd...". The resulting string starts with a minus sign if the number is negative.The number of digits after the decimal point is given by the precision specifier in the format string-a default of 2 decimal digits is assumed if no precision specifier is present.

gGeneral. The argument must be a floating-point value. The value is converted to the shortest possible decimal string using fixed or scientific format. The number of significant digits in the resulting string is given by the precision specifier in the format string-a default precision of 15 is assumed if no precision specifier is present. Trailing zeros are removed from the resulting string, and a decimal point appears only if necessary. The resulting string uses fixed point format if the number of digits to the left of the decimal point in the value is less than or equal to the specified precision, and if the value is greater than or equal to 0.00001. Otherwise the resulting string uses scientific format.

nNumber. The argument must be a floating-point value. The value is converted to a string of the form "-d,ddd,ddd.ddd...". The "n" format corresponds to the "f" format, except that the resulting string contains thousand separators.

<FD><spec> - Format Duration directive, hh.mm.ss.cc

Example: DurationSec=265; <FD><mm' min' ss 'sec' ><DurationSec> -> 04 min 25 sec

  • h
  • Displays the hour without a leading zero (0-23)
  • hh
  • Displays the hour with a leading zero (00-23)
  • m|n
  • Displays the minute without a leading zero (0-59)
  • mm|nn
  • Displays the minute with a leading zero (00-59)
  • s
  • Displays the second without a leading zero (0-59)
  • ss
  • Displays the second with a leading zero (00-59)
  • c
  • Displays the Milli Seconds
    1000 milliseconds = 1 second
To include literal strings in the format, enclose them in single quotes. Failing to quote literal strings can have unpredictable results, even if they do not include formatting codes. Use two single quotes to represent one single quote character in literal string.

<X><what> Extract directive, what: Regular Expressions

<XS><skip><what> Extract and skip from start directive

<XE><what><skip> Extract and skip from end directive

Extractions example:

File name: Artist Name - Album Name - 01of20.mp3

Mask Result
<X><[\w\s]*>$F
Artist Name
<XS><[\w\s]*>< [\w\s]*>$F
Album Name
<XE><[\w\s]*><.{8}>$F
Album Name
<XE><[\w\s]*><-\s\d.*>$F
Album Name

<XLastName> and <XFirstName> name Extraction directives

Patrick O'Brian -> <XFirstName> = Patrick

<XLastName> = O'Brian
  O'Brian, Patrick -> <XFirstName> = Patrick
<XLastName> = O'Brian
  Richard North Patterson -> <XFirstName> = Richard North
 <XLastName> = Patterson
  D. Preston and L. Childs -> <XFirstName> = D.
                              <XLastName> = Preston
  D. Preston & L. Childs   -> <XFirstName> = D.
                              <XLastName> = Preston

<FileItem><number><expression> Reference to another file

<FileList><expression> Create mp3 files list may be used in NFO creation

<FlagFile><dos_mask> Find first file in current directory

Example: <FlagFile><*.sfv> or <FlagFile><*.sfv|*.par>

<TextFile><file_name> Context of the text file specified by name

<T><rus2lat>, <T><lat2rus> Transliteration Cyrillic to Latin

Performs transliteration of ANSI Cyrillic (Windows 1251) text with readable Latin combinations, known as 'Runglish' or 'Volapyuk', and also can perform reverse translation from 'Runglish' text to its Cyrillic equivalent.

<T><#1, #2> Transformation CodePage#1 to CodePage#2,

Example: <T><20866, 1251> KOI8-R -> Cyrillic Windows

<T><file_name> Transformation using configuration file

See example file: transl_rus2lat.txt in Mp3BH installation directory

If no path specified in file name <T> directive will search in mp3BH installation directory first, then current directory.

<Rnd><Number> - Random number generation from 1 to Number

<RndU><Number> - Unique random number generation from 1 to Number, each number would be generated once

Number could be expression

Example: <Rnd><9> will create random number from 1 to 9

     <F><.3d><Rnd><<Total>> will create random number from 001 to number or files in list


<Expr><Expression> - Evaluate the value of mathematical expression

Example: <Expr><2+2> will make 4
     <Expr><<Count>+10> will start enumeration from 11

Custom variables

You could create your own 'custom' variables as combination of predefined variables using Variables Help window. Custom variables name should be included in angle brackets <> and should have name distinct from predefined variables. These Variables are preserved in Mp3BookHelper.ini file.

After installation there are predefined 'custom' variables:

Variable Mask used to build it Description
<Rs4F> <R><^.{4}><>$F Removes first 4 chars from file name
<Rl4F> <R><.{4}\Z><>$F Removes last 4 chars from file name
<ExtStart1F> <X><[^-]*>$F Extract words from start of file name until first -
<ExtStart2F> <XS><[^-]*-><[^-]*><File> Extract 2nd part of file name between -
<ExtStart3F> <XS><[^-]*-[^-]*-><[^-]*>$F Extract 3rd part of file name
<ExtLastF> <X><[^-]*\Z><File> Extract part of file name after last -
<Count01> <F><.2d><Count> Format <Count> left-padded with zero
it would create numbers 01, 02, 03
<CountF01> <F><.2d><CountF> Format <CountF> left-padded with zero
<001> <F><.3d> Format Value left-padded with zero
<IfSeries> <IFE><$S $s - ><> Series if Any of $S or $s are set
<IfReadBy> <IFE><Read by $R><> Read by if $R set
<Tab> <Char 9> Create Tab character

Syntax of Regular Expressions

Introduction

This document is taken from TRegExpr help file, an excellent Regular Expressions library for Delphi, by Andrey V. Sorokin,

Regular Expressions are a widely-used method of specifying patterns of text to search for. Special metacharacters allow You to specify, for instance, that a particular string You are looking for occurs at the beginning or end of a line, or contains n recurrences of a certain character.

Regular expressions look ugly for novices, but really they are very simple (well, usually simple ;) ), handily and powerful tool.

I strongly recommend You to play with regular expressions using Mask Helper.

Let's start our learning trip!

Simple matches

Any single character matches itself, unless it is a metacharacter with a special meaning described below.

A series of characters matches that series of characters in the target string, so the pattern "bluh" would match "bluh'' in the target string. Quite simple, eh ?

You can cause characters that normally function as metacharacters or escape sequences to be interpreted literally by 'escaping' them by preceding them with a backslash "\", for instance: metacharacter "^" match beginning of string, but "\^" match character "^", "\\" match "\" and so on.

Examples:

foobar matchs string 'foobar'

\^FooBarPtr matchs '^FooBarPtr'

Escape sequences

Characters may be specified using a escape sequences syntax much like that used in C and Perl: "\n'' matches a newline, "\t'' a tab, etc. More generally, \xnn, where nn is a string of hexadecimal digits, matches the character whose ASCII value is nn. If You need wide (Unicode) character code, You can use '\x{nnnn}', where 'nnnn' - one or more hexadecimal digits.

\xnn char with hex code nn

\x{nnnn} char with hex code nnnn (one byte for plain text and two bytes for Unicode)

\t tab (HT/TAB), same as \x09

\n newline (NL), same as \x0a

\r car.return (CR), same as \x0d

\f form feed (FF), same as \x0c

\a alarm (bell) (BEL), same as \x07

\e escape (ESC), same as \x1b

Examples:

foo\x20bar matchs 'foo bar' (note space in the middle)

\tfoobar matchs 'foobar' predefined by tab

Other characters need to escape with \ are brackets () [] and backslash itself \

Character classes

You can specify a character class, by enclosing a list of characters in [], which will match any one character from the list.

If the first character after the "['' is "^'', the class matches any character not in the list.

Examples:

foob[aeiou]r finds strings 'foobar', 'foober' etc. but not 'foobbr', 'foobcr' etc.

foob[^aeiou]r find strings 'foobbr', 'foobcr' etc. but not 'foobar', 'foober' etc.

Within a list, the "-'' character is used to specify a range, so that a-z represents all characters between "a'' and "z'', inclusive.

If You want "-'' itself to be a member of a class, put it at the start or end of the list, or escape it with a backslash. If You want ']' you may place it at the start of list or escape it with a backslash.

Examples:

[-az] matchs 'a', 'z' and '-'

[az-] matchs 'a', 'z' and '-'

[a\-z] matchs 'a', 'z' and '-'

[a-z] matchs all twenty six small characters from 'a' to 'z'

[\n-\x0D] matchs any of #10,#11,#12,#13.

[\d-t] matchs any digit, '-' or 't'.

[]-a] matchs any char from ']'..'a'.

Metacharacters

Metacharacters are special characters which are the essence of Regular Expressions. There are different types of metacharacters, described below.

Metacharacters - line separators

^ start of line

$ end of line

\A start of text

\Z end of text

. any character in line



Examples:

^foobar matchs string 'foobar' only if it's at the beginning of line

foobar$ matchs string 'foobar' only if it's at the end of line

^foobar$ matchs string 'foobar' only if it's the only string in line

foob.r matchs strings like 'foobar', 'foobbr', 'foob1r' and so on

The "^" metacharacter by default is only guaranteed to match at the beginning of the input string/text, the "$" metacharacter only at the end. Embedded line separators will not be matched by "^'' or "$''.

You may, however, wish to treat a string as a multi-line buffer, such that the "^'' will match after any line separator within the string, and "$'' will match before any line separator. You can do this by switching On the modifier /m.

The \A and \Z are just like "^'' and "$'', except that they won't match multiple times when the modifier /m is used, while "^'' and "$'' will match at every internal line separator.

The ".'' metacharacter by default matches any character, but if You switch Off the modifier /s, then '.' won't match embedded line separators.

TRegExpr works with line separators as recommended at www.unicode.org ( http://www.unicode.org/unicode/reports/tr18/ ):

"^" is at the beginning of a input string, and, if modifier /m is On, also immediately following any occurrence of \x0D\x0A or \x0A or \x0D (if You are using Unicode version of TRegExpr, then also \x2028 or \x2029 or \x0B or \x0C or \x85). Note that there is no empty line within the sequence \x0D\x0A.

"$" is at the end of a input string, and, if modifier /m is On, also immediately preceding any occurrence of \x0D\x0A or \x0A or \x0D (if You are using Unicode version of TRegExpr, then also \x2028 or \x2029 or \x0B or \x0C or \x85). Note that there is no empty line within the sequence \x0D\x0A.

"." matchs any character, but if You switch Off modifier /s then "." doesn't match \x0D\x0A and \x0A and \x0D (if You are using Unicode version of TRegExpr, then also \x2028 and \x2029 and \x0B and \x0C and \x85).

Note that "^.*$" (an empty line pattern) does not match the empty string within the sequence \x0D\x0A, but matchs the empty string within the sequence \x0A\x0D.

Multiline processing can be easily tuned for Your own purpose with help of TRegExpr properties LineSeparators and LinePairedSeparator, You can use only Unix style separators \n or only DOS/Windows style \r\n or mix them together (as described above and used by default) or define Your own line separators!

Metacharacters - predefined classes

\w an alphanumeric character (including "_")

\W a nonalphanumeric

\d a numeric character

\D a non-numeric

\s any space (same as [ \t\n\r\f])

\S a non space

You may use \w, \d and \s within custom character classes.

Examples:

foob\dr matchs strings like 'foob1r', ''foob6r' and so on but not 'foobar', 'foobbr' and so on

foob[\w\s]r matchs strings like 'foobar', 'foob r', 'foobbr' and so on but not 'foob1r', 'foob=r' and so on

TRegExpr uses properties SpaceChars and WordChars to define character classes \w, \W, \s, \S, so You can easily redefine it.

Metacharacters - word boundaries

\b Match a word boundary

\B Match a non-(word boundary)

A word boundary (\b) is a spot between two characters that has a \w on one side of it and a \W on the other side of it (in either order), counting the imaginary characters off the beginning and end of the string as matching a \W.

Metacharacters - iterators

Any item of a regular expression may be followed by another type of metacharacters - iterators. Using this metacharacters You can specify number of occurrences of previous character, metacharacter or subexpression.

* zero or more ("greedy"), similar to {0,}

+ one or more ("greedy"), similar to {1,}

? zero or one ("greedy"), similar to {0,1}

{n} exactly n times ("greedy")

{n,} at least n times ("greedy")

{n,m} at least n but not more than m times ("greedy")

*? zero or more ("non-greedy"), similar to {0,}?

+? one or more ("non-greedy"), similar to {1,}?

?? zero or one ("non-greedy"), similar to {0,1}?

{n}? exactly n times ("non-greedy")

{n,}? at least n times ("non-greedy")

{n,m}? at least n but not more than m times ("non-greedy")

So, digits in curly brackets of the form {n,m}, specify the minimum number of times to match the item n and the maximum m. The form {n} is equivalent to {n,n} and matches exactly n times. The form {n,} matches n or more times. There is no limit to the size of n or m, but large numbers will chew up more memory and slow down r.e. execution.

If a curly bracket occurs in any other context, it is treated as a regular character.

Examples:

foob.*r matchs strings like 'foobar', 'foobalkjdflkj9r' and 'foobr'

foob.+r matchs strings like 'foobar', 'foobalkjdflkj9r' but not 'foobr'

foob.?r matchs strings like 'foobar', 'foobbr' and 'foobr' but not 'foobalkj9r'

fooba{2}r matchs the string 'foobaar'

fooba{2,}r matchs strings like 'foobaar', 'foobaaar', 'foobaaaar' etc.

fooba{2,3}r matchs strings like 'foobaar', or 'foobaaar' but not 'foobaaaar'

A little explanation about "greediness". "Greedy" takes as many as possible, "non-greedy" takes as few as possible. For example, 'b+' and 'b*' applied to string 'abbbbc' return 'bbbb', 'b+?' returns 'b', 'b*?' returns empty string, 'b{2,3}?' returns 'bb', 'b{2,3}' returns 'bbb'.

You can switch all iterators into "non-greedy" mode (see the modifier /g).

Metacharacters - alternatives

You can specify a series of alternatives for a pattern using "|'' to separate them, so that fee|fie|foe will match any of "fee'', "fie'', or "foe'' in the target string (as would f(e|i|o)e). The first alternative includes everything from the last pattern delimiter ("('', "['', or the beginning of the pattern) up to the first "|'', and the last alternative contains everything from the last "|'' to the next pattern delimiter. For this reason, it's common practice to include alternatives in parentheses, to minimize confusion about where they start and end.

Alternatives are tried from left to right, so the first alternative found for which the entire expression matches, is the one that is chosen. This means that alternatives are not necessarily greedy. For example: when matching foo|foot against "barefoot'', only the "foo'' part will match, as that is the first alternative tried, and it successfully matches the target string. (This might not seem important, but it is important when you are capturing matched text using parentheses.)

Also remember that "|'' is interpreted as a literal within square brackets, so if You write [fee|fie|foe] You're really only matching [feio|].

Examples:

foo(bar|foo) matchs strings 'foobar' or 'foofoo'.

Metacharacters - subexpressions

The bracketing construct ( ... ) may also be used for define r.e. subexpressions (after parsing You can find subexpression positions, lengths and actual values in MatchPos, MatchLen and Match properties of TRegExpr, and substitute it in template strings by TRegExpr.Substitute).

Subexpressions are numbered based on the left to right order of their opening parenthesis.

First subexpression has number '1' (whole r.e. match has number '0' - You can substitute it in Replace directive <R> as '$0' or '$&').

Examples:

(foobar){8,10} matchs strings which contain 8, 9 or 10 instances of the 'foobar'

foob([0-9]|a+)r matchs 'foob0r', 'foob1r' , 'foobar', 'foobaar', 'foobaar' etc.

Metacharacters - backreferences

Metacharacters \1 through \9 are interpreted as backreferences. \<n> matches previously matched subexpression #<n>.

Examples:

(.)\1+ match 'aaaa' and 'cc'.

(.+)\1+ also match 'abab' and '123123'

(['"]?)(\d+)\1 match '"13" (in double quotes), or '4' (in single quotes) or 77 (without quotes) etc

Book Helper Examples:

<R><^The (.*)><$1, The>$B match 'The Gathering' and returns

<R><^(The )(.*)><THE \$2>$B match 'The Gathering' and returns THE

Note: \$2 is used to avoid conflicts with $2 Mp3BH variable,

\0, \1 through \9 are translated to $0, $1... $9 so you could use any of this for substitutions

Modifiers

Modifiers are for changing behavior of RegExpr.

There are many ways to set up modifiers.

Any of these modifiers may be embedded within the regular expression itself using the (?...) construct.

Also, You can assign to appropriate RegExpr properties (Modifier for example to change /x, or ModifierStr to change all modifiers together). The default values for new instances of TRegExpr object defined in global variables, for example global variable RegExprModifierX defines value of new TRegExpr instance ModifierX property.

i

Do case-insensitive pattern matching (using installed in you system locale settings), see also InvertCase.

m

Treat string as multiple lines. That is, change "^'' and "$'' from matching at only the very start or end of the string to the start or end of any line anywhere within the string, see also Line separators.

s

Treat string as single line. That is, change ".'' to match any character whatsoever, even a line separators (see also Line separators), which it normally would not match.

g

Non standard modifier. Switching it Off You'll switch all following operators into non-greedy mode (by default this modifier is On). So, if modifier /g is Off then '+' works as '+?', '*' as '*?' and so on

x

Extend your pattern's legibility by permitting whitespace and comments (see explanation below).

r

Non-standard modifier. If is set then range - additional include russian letter '', - additional include '', and - include all russian symbols.

Sorry for foreign users, but it's set by default. If you want switch if off by default - set false to global variable RegExprModifierR.

The modifier /x itself needs a little more explanation. It tells the TRegExpr to ignore whitespace that is neither backslashed nor within a character class. You can use this to break up your regular expression into (slightly) more readable parts. The # character is also treated as a metacharacter introducing a comment, for example:

(
(abc) # comment 1
  |   # You can use spaces to format r.e. - TRegExpr ignores it
(efg) # comment 2
)

This also means that if you want real whitespace or # characters in the pattern (outside a character class, where they are unaffected by /x), that you'll either have to escape them or encode them using octal or hex escapes. Taken together, these features go a long way towards making regular expressions text more readable.

Perl extensions

(?imsxr-imsxr)

You may use it into r.e. for modifying modifiers by the fly. If this construction inlined into subexpression, then it effects only into this subexpression

Examples:

(?i)Saint-Petersburg matchs 'Saint-petersburg' and 'Saint-Petersburg'

(?i)Saint-(?-i)Petersburg matchs 'Saint-Petersburg' but not 'Saint-petersburg'

(?i)(Saint-)?Petersburg matchs 'Saint-petersburg' and 'saint-petersburg'

((?i)Saint-)?Petersburg matchs 'saint-Petersburg', but not 'saint-petersburg'

(?#text)

A comment, the text is ignored. Note that TRegExpr closes the comment as soon as it sees a ")", so there is no way to put a literal ")" in the comment.

Examples of Masks and Name Extraction

How to make a file name max 50 characters long not using Smart Trim?

 <Artist> <Album> $I - $N - <Title><X><.{50}>

How to extraction of artist track title, album from filenames?

Suppose you have Beatles White Album and files are stored as:

The Beatles\White Album\08 - Revolution 1.ogg
The Beatles\White Album\11 - Cry Baby Cry.ogg

Simple way: Use Filename to Tags dialog:

<Artist>\<Album>\<Track#> - <Title>

Advance way: In Tags tab enter following:

Tag name Mask Result
Artist/Author
<PFolder>
The Beatles
Album/Book
<Folder>
White Album
Track Title
<XS><[\d\s]*>< [\w\s',]*>$F
Revolution 1
Year 1968 1968

All information in file name:

The Beatles - The White Album - Disk 2 - 12 Revolution 9.ogg
The Beatles - The White Album - Disk 2 - 13 Good Night.ogg

Simple way: Filename to Tags dialog:

<Artist> - <Album> - <Ignore> - <Track#> <Title>

Advance way: In Tags tab enter following:

Tag name Mask Result
Artist/Author
<X><[\w\s]*>$F
The Beatles
Album/Book
<XS><[\w\s]*><[\w\s]*>$F
The White Album
Track Title
<XS><.*-\s\d+><[\w\s',]*>$F
Revolution 9
Track#
<XS><.*Disk \d+><\d.><File>
12

Useful Regular expressions Examples:

<FileCRC><R><^[\d\s-]*><> Removes starting Numbers spaces and - from SFV file name
<R><^.{4}><>$F
Remove first 4 characters from file name
<R><^[\w]*><>$F
Remove first alphanumeric characters from file name
<R><(?i)[a-z]*\Z><>$F
Remove last letters from file name, ignore case
<XS><[^ ]*><.*>$F Skip First word
   

Other variables behavior examples:

<Artist> = Paul McCartney <Album> = Back In The U.S.

Mask Result
<Artist> <Album>
Paul McCartney Back In The U.S.
<CL><Artist> <Album>
paul mccartney Back In The U.S.
<CL>[[<Artist> <Album>]]
paul mccartney back in the u.s.
<UM><Artist>
Paul Mc Cartney
<R>< ><*><Artist>
Paul*McCartney
<UM><R>< ><*><Artist>
Paul*Mc Cartney
<R>< ><*><UM><Artist>
Paul*Mc*Cartney

<Album> = The White Album - Disk 2, you want: The White Album - D2

There are many ways to do this now:

<R>< - Disk >< D><Album>

This would replace ' - Disk' by ' D' from Album

Or you could remove all from Album after ' -' and Extract the last number from Album:

<R>< -.*><><Album> D<X><\d+><Album>

Or get part of Album before first '-'

<X><[^-]*><Album>D<X><\d+><Album>

Export/Import ID3 or Ogg-tags to/from CSV, XLM or text file

With 'Save tags to file' functionality you can export your Mp3 files information to CSV (Comma - Separated - Values) and then easy export it to MS Excel or any other database or edit this file in you favorite text editor, and apply to mp3 tags or file names using 'Load tags from file' command.

To do this you need to:

1) Select tags type ID3v1 or ID3v2 in main form.

2) Select from menu 'Tags', 'Save tags to file'.

3) Select tags and file information you want to export.

4) Choose exported file name and press 'Save'.

Currently CSV, Text and XML file types are supported.

To import tags from text file and apply to your mp3 files you need:

1) Select tags type ID3v1 or ID3v2 in main form.

2) Select from menu 'Tags', 'Load tags from file'.

3) Choose file name and press 'Read file'. Information from this file would be shown in 'Data loaded from file:'.

4) Choose tags you want to Import and map column name from file to this tag.

5) 'Preview Tags' show changes in main window.

6) 'Apply Selected Tags' will change tags of you files.

You could change the way items (lines) in file are mapped to loaded files. Your options are: 'Line -> File', 'Line -> Checked File', 'Join using key'.

Special case 'Join using key' allows you to change only files with matching names or tags. In this case order of files and lines in text file do not affect changes made to files.

Join Example 1:

Text CSV file:

"Col1 File Name", "Col2 Tag 1", "Col3 Tag 2"
file1.mp3, Tag11, Tag12
file2.mp3, Tag21, Tag22

If you set Column "Col1 File Name" as key and Map it to file name than only files with names 'file1.mp3' and 'file2.mp3' would be changed.

Join Example 2:

"Old File Name", "New File Name"
file1.mp3, Tag11
file2.mp3, Tag21

If you set Column 'Old File Name' as key and Map it to 'File name' and 'New File Name' also maps to 'File Name' than only files with names 'file1.mp3' and 'file2.mp3' would be renamed to 'Tag11.mp3' and 'Tag21.mp3' accordingly.



You could set more than one key then all keys should mach.

"Old Album", "Old Artist", "New Album", "New Artist"
"Album1", "Artist1", "My New Latest Album", "New Artist"
"Album2", "Artist1", "My New Cool Album", "New Artist"

If "Old Album", "Old Artist" set as keys and mapped accordingly and "New Album", "New Artist" are mapped as values then all files with "Album1" and "Artist1" would be changed to "My New Latest Album", "New Artist". In fact it is easier to use find and replace in this case.

If you made a mistake in Import you are able to Undo complete import operation.

Filename to Tags

This function is useful if you have files without tags or with some tags but the filenames or directory structure contains information about the artist, title, etc.

To get tags from File names select the files to edit as above. Select Menu 'Tags' -> 'Filename to Tag' or Click button in toolbar.

Filename format describes how file name would be converted to Tags.

Example 1: All information in file names:

The Beatles - The White Album - Disk 2 - 12 Revolution 9.ogg
The Beatles - The White Album - Disk 2 - 13 Good Night.ogg

Filename format in this case:

<Artist> - <Album> - <Ignore> - <Track#> <Title>

Example 2: You have Beatles White Album and files are stored as:

The Beatles\White Album\08 - Revolution 1.ogg
The Beatles\White Album\11 - Cry Baby Cry.ogg

Filename format in this case:

<Artist>\<Album>\<Track#> - <Title>

Filename format consists of tag variables and separators. Variables is subset of Variables used in batch tagging: <Album>, <Artist>, <Title>, <Year>, <Genre>, <Track#>, <Comment>, <Composer>, <Encoder>, <Copyright>, <URL> or short versions dollar style: $B, $A, $T, $Y, $G, $K, $C

Special variable <Ignore> or $Z would ignore text portion of file name between separators.

Filename format works base on separators! Separator could be space or any other character. You could not specify mask like this <Artist><Title> if separator is missing space is assumed. In case if you have file: The Beatles Revolution 1.ogg your best approach would be to use mask: The Beatles <Title> and then apply Artist to tags in batch editing. If you try format <Artist> <Title> with space between tags you will get wrong tags: Artist would be "The" first part of file name before first space and Title would be the rest of the file name string "Beatles Revolution 1".

If the folder name contains some track information you may use the '\' or '<\>' symbols in the file name mask.

Separators could be regular expressions. Separators will not become part of tags.

Filename format has following syntax:

[sep][<Rx>]<Var>[[sep][<Rx>]<Var>]...[sep][||Another_Format].

Where sep separator, <Rx> regular expressions for values, <Var> variable

Last separator is optional, last variable takes everything until the end of string.

If you enable Regular expressions than any variable could be preceded with regular expressions. Parser would match this expression in portion of the file name currently parsed and if it matches value would be used. Otherwise portion of file name between separators would be used.

Enabling Complete Match switch would not apply changes to files with mismatching separators or regular expressions. You could combine more that one format string using or || directive. Mp3BH will try to mach them sequentially.

Use Preview all the time to see how this format will work for your files.

This dialog uses the same approach as "mask builder" in help. You could Drag and Drop variables to the list "Format as list". The list is itemized representation of the format string "Filename format". You could move each variable up or down using Mouse you. The only purpose of Format builder is to help you in typing variables. It can't do more than variables could. Result of Format builder is one string.

On Initial file load if Options 'Batch' Tag Guess Tag Masks to Dropdown is enabled special expression is executed and Dropdown are preloaded with results. This is done base on first file in the list. Default after installation expression is (it is all one line but split here to simplify reading):

<Series> <^\d+><Series#> {<Book>} \(<Author>\)\$<A|U><Abridged>.*<\><Ignore>||
<Book> \(<Author>\)\$<A|U><Abridged>.*<\><Ignore>||
$A - <Series> <^\d+><Series#> - $B - <(abr)|(unabr)><Abridged><\><Ignore>||
<Author> - <Series> <^\d+><Series#> - <Book><\><Ignore>||
<Author> - <Book> - <(abr)|(unabr)><Abridged><\><Ignore>||
<Author> - <Book><\><Ignore>

You could use <Author>, <Book>, <Year>, <Abridged>, <ReadBy> <Series> <Series#> variables.

More about regular expressions:

Example 1: Separator - regular expressions:

The Beatles - The White Album - 12 Revolution 9.ogg
The Beatles _  The White Album _ 13 Good Night.ogg

Second file name has underscore instead of dash and two spaces as separator!

Filename format in this case:

<Artist> [-_\s]+ <Album> [-_\s]+ <Track#> <Title>

Regular expression in this case is: space[-_\s]+space or \s[-_\s]+\s

Example 2: No Separators - use regular expressions:

The Beatles\The White Album\BWA12Revolution 9.ogg
The Beatles\The White Album\BWA13Good Night.ogg

There are no separator between Track# and Title!

Filename format in this case:

<Artist><\><Album><\>BWA<\d+><Track#><Title>

Regular expression in this case is: <\d+> it is regular expressions (any number of digits) for values of <Track#>

'BWA' Would be ignored, considered as separator

Example 3: Use regular expressions to verify format applicability

08 - Revolution 1.ogg
White Album 11 - Cry Baby Cry.ogg

Filename format in this case:

[\d]*<\d+><Track#> - <Title>

If you try: <Track#> - <Title> you will get Track number: White Album 11 for second file and this not what you expect. [^\d]* will ignore anything until first number in the front of file name.

Other Examples:

08 - Revolution 1.ogg
White Album 11 - Cry Baby Cry.ogg

Filename format in this case:

<^\d+><Track#> - <Title>||<\S+\s\S+><Album>\s<\d+><Track#> - <Title>

Invalid expressions are handled this way:

<RegExpr1>RegExpr2<Title> same as RegExpr1RegExpr2<Title>
RegExpr1RegExpr2 is used as separator.
<RegExpr1><RegExpr2><Title> same as RegExpr1<RegExpr2><Title>
RegExpr1 is used as separator.
<RegExpr1>RegExpr2<RegExpr3><Title> same as RegExpr1RegExpr2<RegExpr3><Title>
RegExpr1RegExpr2 is used as separator.

Format syntax: <RegExpr><Ignore><Title> is the same as RegExpr<Title> and this is not the same as <RegExpr><Title>.

Import tags from freedb

This function may be useful if you have full albums as MP3 or OGG files and you know in which order the tracks appear on the CD. You must be connected to the Internet for this function to work properly.

freedb http://www.freedb.org/ is a database to look up CD information using the internet. This is done by a client (a freedb aware application) which calculates a (nearly) unique disc ID for a CD in your CD-Rom and then queries the database. As a result, the client displays the artist, CD-title, tracklist and some additional infos. You can also search for CD-info in the freedb via the web-based search.

Mp3BookHelper is not using disc in your CD-Rom to calculate DiscID. It uses song order and track time as two parameters to calculate DiscID and retrieve song information. If disc is not found using calculated DiscID you could find it using web-based search and enter it manually for Mp3BookHelper to retrieve track list.

How to get song information using freedb?

  1. Connect your PC to the Internet

  2. Change Proxy settings in Mp3BH Options if you are using Proxy

  3. Sort selected files in the order they appear on CD

  4. Click the "Get tags from freedb" button on the toolbar

  5. In the New Form press "Connect"; Mp3BH would show a list of found albums

  6. Click on the Albums to see/retrieve track list for album

  7. Select which tags should be changed

  8. "Preview" will show changes to be made in main window.

  9. "Apply Tags" will change tags of you files.

If you made a mistake in Import you are able to Undo complete import operation.

Renaming Files

For File Renaming select the files to edit as above. Click the tab labeled "Tags" near the top left of the screen to select the tag editing tab sheet. Use the "Select Tag" combo box to pick "File Name." You may then proceed with file renaming in exactly the same way as setting the ID3 tags as discussed above. Note that the special variables are available. If mask result would produce unacceptable for file name characters: : \ / ? * this characters would be removed from resulting filename.

In File Options you could specify maximum file name length in characters, if exceeded than it would be truncated of "Smart Trimmed" if "Smart Trim" enabled.

NOTE: . (Dot) before extension is not counted. Joliet file system for CDs has 64 character including the extension Mac user using any system earlier than OSX has a 32-character limit.

If you made a mistake you are able to Undo file rename to the beginning of session.

More advance features for file renaming could be found in tab labeled "Move". It allows renaming and moving folders with sound files. Use 'Preview' to see how it works.

Case change and Replace inputs affect only file names. For folders you should enter <C?> and <R><><> mask directives to Folder name Mask.

Folders Operation - Rename:

Rename folder(s) base on supplied mask and/or move to 'base location'. It only changes names for Existing folders. Files are not moved between folders. Folder name Mask takes data from first sound file in this folder.

Folders Operation - Restructure:

Moves files to folders base on supplied mask and 'base location'. Folders would be created and each file would be moved to appropriate folder. You could create structure like: C:\My Music\My Author\My Album\My File 2.mp3 using folder mask: <Author><\><Album>. Folder name Mask takes data from each sound file so it is possible to move each loaded file to individual folder.

Folders Operation - Fill SFV/PAR:

Moves files to folders base on SFV/PAR in 'base location'.

Program would scan all subfolders of Base location and finds all PAR/SFV files there. Then for each sound file it would try to find SFV or PAR file that contains its name (checksums are ignored if use CRC is unchecked). If found sound file would be moved to the same folder where SFV or PAR located. New folders are not created during this operation.

Folders Operation - Group SFV/PARs

Groups and Moves sound files to folders base on SFV/PAR files that contains its name. Works like 'Restructure' only Folder name Mask ignored and new folder name would have the same name as SFV or PAR file.

This operation does 'Fill' of existing folders and then creates new folders for each SFV/PAR from original location and then does 'Fill' operation again for new folders.

If new folder name mask results is invalid folder name than it would be automatically corrected:

  • \\ replaced with \

Example: $G\\$A\\$B will produce: Genre\Author\Album but if tag genre is empty string this masks will produce new folder Author\Album

Checkbox 'Move support files' instruct program to move associated SFV, PAR and files with 'similar name' together with sound files. 'Similar name' is a name of SFV/PAR file with different extension, for example .NFO.

Checkbox 'Keep Empty folders' instruct program not to remove empty folders where sound files has been stored originally

Disabled (gray) controls have no effect on the result of operation. There is no Undo for folder names and for moved support files.

Playlist Generation

Using "File - Select Files" or drag-and-drop from Windows Explorer (anywhere onto the form), bring all the files for a book into the program. You're quickly presented with a list of your files, with their sizes and durations, and the total size and duration of the set of files.

Click 'Generate' -> 'Playlists' in the menu or F6

If you enabled multiple playlists than enter your playlist limits, in "Max size" per playlist (typically for Rio users) or in "Max Length" (duration) (typically for tape users).

Select an output path in the "Playlist name" and "Playlist location" fields. For multiple playlists "Playlist name" is the prefix; it will have a sequence number appended to it. For example, if you enter "book" your first playlist will be "book.m3u" if only one file to be generated. Or "book01.m3u", "book02.m3u"... for multiple playlists depends on limit set.

To do another book, click 'File' -> 'Clear list' or F5

"Playlist name " is generated based on Mask for M3U Files. This could be changed in options. Default value is $A - $B

"Playlist location" defaults to location of mp3 files. If you change it than relative path would be used in m3u file (The same way as WinAmp does)

NFO Generation

After setting the ID3 tags in the step above, click on the "NFO Generator" tab near the top left of the screen. The program uses the ID3 tag and other file information to make its best guess at what you'd want to say in an NFO file. Fill in the remaining blanks; change anything you like (other than the "encoded at" field which already reflects reality).

Click 'Generate' -> 'NFO' (or hot key F7) to save the resulting file.

Created file would be show in internal text Editor and optionally External text Editor could be started.

Additional format Styles could be specified in options.

If you want custom or extended information in your NFO file then select Custom Template as NFO style and enter or select the name of template file.

Template file uses variables derived from information entered on NFO Generator screen and Set Tags variables for <FileList> and <FileItem> creation.

Example template (NFOtemplate.txt, NFOtemplateHTML.txt and NFOtemplateStandard.txt) installed to Mp3BookHelper application directory. This is short extract from this file.

General Information
===================
 Title:                  <Title>
 Author:                 <Author>
 Read By:                <ReadBy><SkipEmpty>
 Copyright:              <PublicationDate><SkipEmpty>
 Audiobook Copyright:    <RecordingDate><SE>
 Genre:                  <Genre><SE>
 Publisher:              <Publisher><SE>
 Series Name:            <Series><SE>
 Position in Series:     <SeriesPosition><SE>
 Abridged:               <AbridgedYesNo>

File Information
================
 Number of MP3s:         <Mp3Files>
 Total Duration:         <Duration>
 Total MP3 Size:         <FilesSize> MB
 Cover Image present:    <IF><<FlagFile><*.gif><FlagFile><*.jpg>><YES><NO>

<FileListID3v1><<File> <FileSizeMB> <DurationHHMM> <EncBr> kbit/s <EncKHz> KHz>
<FileItem><1><<Directory>\\<File><FileExt>>

Book Description
================
<Wrap><Description>

Other variables:

<Composer>, <EncodedBy>, <Copyright> and <Link> taken from ID3 tags

<NowDate> and <NowTime> Current system date

<FilesDate> <FilesTime> Earliest Sound File Creation Date and Time

Creation of parity archive (PAR)

PAR/P01/./P?? (Parity Archive Volume Set) files are used for data recovery. Mp3BookHelper has interface only for PAR v1 set creation. Currently recovery is not enabled in this program. If you need to recover files use PAR clients. Mp3BookHelper offers you a simple interface for PAR file naming and has no intention to compete with general-purpose PAR clients FSRaid and SmartPAR.

To create the Parity Archive Volume Set after you updated Tags and/or renamed files press F9 or select 'Create PAR/SFV' from menu. You would be able to select number of PXX volumes for recovery. For each lost or corrupted mp3 file you would need one PXX volume to be able to recover original file. Only mp3 files are included in set. If you have files from more than one directory loaded to program PAR would be created for each directory.

One PAR volume set could contain up to 255 files. To work around this limitation Mp3BookHelper would create 2 or more sets for each directory with more than 255 files equally dividing mp3 files between volumes.

Example is 280 files. 2 sets would be created 1st would have files from 1 to 140 2nd set files from 141 to 280. You would be able to select suffix for this sets it could be 001_140 for set 1 and 141_280 for set 2. Or it could be a set number.

Example for file naming:

B001-280 Author - Book.mp3
.
B280-280 Author - Book.mp3
B000-280 Author - Book.sfv

PAR/PXXs created base on <2B>$0_<Total> <Author> - <Book>_ mask for base par file name:

B000-280 Author - Book_001_140.par
B000-280 Author - Book_001_140.p01
B000-280 Author - Book_001_140.p02
B000-280 Author - Book_141_280.par
B000-280 Author - Book_141_280.p01
B000-280 Author - Book_141_280.p02

You could create PAR set immediately or delay it creation using Schedule button. Schedule would put PAR/SFV creation command to Task Queue.

If you change you mp3 files after PAR or SFV was created you will get warning message when you try to close program or clear file list.

Drop Down list for PAR and SFV name mask contains recently used masks plus the last mask used for mp3 file renaming where all counter variables ('$i', '$I', '<Count>', '<Count1>', '$l', '$L', '<Count0>', '$k', '$K', '<Track#>') are replaced by place holder variable $0.

SFV/SV/PAR Generation and SFV/SV/PAR Tests

.SFV (Simple File Verificator) files are used to ensure that files are not corrupt and not missing. These files contain CRC32 (Cyclic Redundancy Checksum) of files and file size in comments section.

.PAR/P01/./P?? (Parity Archive Volume Set) files are used for data recovery. Mp3BookHelper do not recover files in current version but uses this files in the same way as SFV for fast test for completeness and correct size of mp3 files. If you need to recover files use PAR clients http://parchive.sourceforge.net/

.SV (Sound Verification Checksum) MP3BookHelper now able to calculate CRC for non-tag parts of a mp3 file (non-tag-CRC, Audio Only) and store this information in .SV files. Using that, you can change tags with any program you want, and then verify that that the sound in the mp3 has not changed to be sure that the program you are using has not corrupted the sound.

Also you could repost renamed and changed tags files to news group and ppl should be able to verify new set of files using previously posted .SV files. .SV stands for Sound Verification and is effectively list of CRC for non-tag parts of a mp3 file. non-tag-CRC in .SV would be changed if you normalize Mp3 files, change Encoding and so on. non-tag-CRC should work correctly with any changes in ID3v1, ID3v2 and Lyrics tags -> non-tag-CRC would remain the same.

MP3BookHelper could create special files .SV with non-tag-CRC also non-tag-CRC could be added to comments portion of .sfv files created by Mp3BH.

How does the non-tag-CRC (mp3-crc) get calculated? The tool is searching for the first valid frame, this is the start of Mp3Data. Then it finds ID3v1 and Lyrics Tags at the end of file. End of Mp3Data is where this Tags if any begin. Standard crc32 of the mp3data calculated and used. If there is a truncated frame at the end of the file it gets into calculated CRC so if you fix this later in any tool Mp3BH would show that the file is changed.

To create the Simple File Verify (SFV) Checksum files after you updated Tags and/or renamed files press F8 or select 'Create SFV/SV' from menu. If you change you mp3 files after SFV was created you will get warning message when you try to close program or clear file list.

If you get the files over Internet than it is a good idea to test if you got all files and they are not corrupted using 'Files' tab of main window.

'SFV/PAR:' would show SFV files from mp3 files directory. You could test your MP3 files against any of these files. Results would be shown in 'Test result' column.

PAR files and some SFV files have file size in comments section. Mp3BookHelper will use this information to quickly compare your mp3 files size with information available. 'Size OK', 'File Truncated' or 'Extra data' would be shown base on this data.

If files have been renamed program could try guess and match you existing files against information in SFV. 'Renamed' would be shown. Currently only spaces and punctuations removed from file names could be detected automatically.

'Test' will calculate CRC checksum and/or MD5 hash of your mp3 files and compare them with information in selected SFV and PAR files. Test result would be: Good = 'CRC OK' or Corrupted = 'CRC Mismatch'.

TSIZ-support. When a new ID3v2-Tag is saved, then there is always a TSIZ-frame saved. This frames stores the length of the MP3-file without the ID3v2 and ID3v1 header. If this frame exists, then the stored one will be used. If it does not exist then it would be created on first tag update. It is never changed! In the tests you see when the TSIZ-info doesn't match the actual size. Mp3BookHelper will use this information to quickly compare your mp3 files size with information available. '(TSIZ)Size OK', '(TSIZ)File Truncated' or '(TSIZ)Extra data' would be shown base on this data.

Other tests results are:

'Error'Error reading file
'Duplicate'File with the save CS was found in the file list of in duplicates DB
'MpegOK'Only SV checksum match.
'CRC Mismatch'Non of checksums CRC, MD5 or SV match
'File Missing'Mp3/Ogg file included in SFV/PAR file not found
'File Not Loaded'File exists but not loaded to Mp3BookHelper. Use 'Load Remaining' button to load it(them) to file list
'No CRC Data'Your mp3 file do not have corresponding SFV or PAR file
CRC ?there are CRC or MD5 data for your file but you need to run 'Test SFV' to get results.

If you have more than one SFV or PAR file in directory test result will show number before any result. This number indicates which SFV or PAR file has been used for tests. If mp3 file present in two files then best match result would be shown. Best is Good = 'CRC OK'. Check and Uncheck PAR/SFV files to compare your files with selected files. No need to run 'Test' again MP3BookHelper remember files checksum in memory.

In some case Mp3BookHelper is able to find missing files even without SVF. Currently file names enumeration is used. For example is loaded files are abook_01-06.mp3, abook_02-06.mp3, abook_04-06.mp3, abook_05-06.mp3. Than it will show warning that file abook_03-05.mp3 is missing. It will not show warning for file abook_06-06.mp3

File filters 'Loaded & Missing' and 'Missing only' should be used to show missing files in 'Files' tab.

MP3BookHelper work under assumption that all files in one directory are related and belong to one book (Album).

After tests MP3BookHelper will create hidden .sfvt file in each directory. .sfvt contains the list of tested files so Mp3BH don't need to re-test files again. Mp3BH reads these files automatically. Automatic creation of .sfvt files could be disabled in options: File->Options->Other->Keep tested files DB [x] creates files .sfvt

Main window hotkeys

By default Mp3BookHepler would respond to player control keys on multimedia keyboard.

F3 Select Files
F4 Select Directory
F5 Clear file list
Shift + F5 Clear file list and do not create .SFVT
F2 Set all selected tags for all files
Ctrl + Enter Preview in Batch Tags
Ctrl + F2 Show mask builder for current mask
F6 Generate playlist(s)
F7 Generate NFO file
F8 Create SFV file
F9 Create PAR and/or SFV
Ctrl+F3 Copy all ID3 v2 tags to ID3 v1
Alt+F3 Copy all ID3 v1 tags to ID3 v2
Ctrl+F5 Remove all ID3 v1 tags from all files
Alt+F5 Remove all ID3 v2 tags from all files
Delete Remove file from the list
Ctrl + Del Remove file from list to System Recycle bin
Ctrl + F Find and Replace dialog
F10 Edit tags or rename one File
Ctrl + F10 Filename to tags dialog
Ctrl + F9 Get tags from freedb
Alt + 1 Edit ID3v1 tags
Alt + 2 Edit ID3v2 tags
Ctrl + BackSp Undo last tag operation
Alt + BackSp Undo last rename operation

Some of this keys you could change using 'View' ->'Customize' Dialog.





Download MP3 Book Helper (2.5 MB)