View Single Post
  #1  
Old 2004-12-02, 02:52 AM
Five's Avatar
Five Five is offline
 
Join Date: Oct 2004
Location: Canada
Foobar2000 SHN > FLAC Conversion: A Visual Guide

Here's the visual tutorial based on (and quoting from) these threads:
http://www.thetradersden.org/forums/...read.php?t=761
http://www.thetradersden.org/forums/...read.php?t=928

Lemmieknow what you think.

SHN to FLAC Conversions Using Foobar2000

First off, special thanks to RainDawg who wrote much of the text included here and gave me the knowledge to create this visual tutorial.

As for converting, it is acceptable and encouraged to convert SHN to FLAC, as the former is an outdated and obsolete codec. FLAC has numerous advantages, and you can read a little more about the major differences in the FAQ's audio types and descriptions entry:
http://www.thetradersden.org/forums/...#faq_filetypes

Foobar2000 Installation and Configuration

Now, foobar2000 is the complete solution to PLAYING your files, but you may not realize that it comes with an enormous amount of plugins that help you do everything else with those files too. First, make sure you've got the Special Installer version 0.8.3 (the most complete and up to date version) from the foobar2000 blogiste.

When you install this program, make sure you include all of the plugins (some may not be useful to you, but they are all fun to play with and learn what options are out there). This will make sure that you have the diskwriter plugin, which will allow you to do direct file conversions.

When the foobar2000 installer promts you to select installation type, select "Full".



The next thing you need to do is configure foobar2000. Go to Foobar2000>Preferences.



On the left, click on "Diskwriter". Under "Output presets" press the "Add new" button. A new window will appear with the title "Select file writer". Select FLAC.



A new window will appear with the title "FLAC encoding settings". Set "Compression level" to 8. Since FLAC decompresses at the same speed no matter what the compression setting is during encoding, it is best to encode your FLACs with the maximum available compression.

The padding is a certain amount of space left at the beginning of the file, before the audio portion, for adding tags (aka Vorbis comments). You can force this to be something other than the default 4096, but it's not recommended. What creating this default space does is allow people to add and edit tags without having to rewrite the entire file....

Unles you're putting a sick amount of information (pages of text for a single track) the 4096 should be plenty. Of couse, it's awfully rude to decrease this value as people who download your seeds WILL want the freedom to add whatever tags they choose.

Click "OK".



Next, configure foobar2000 so that filenames aren't changed and the output is in the same directory as the source files. Set "Output directory" to "Same as source file directory" and under "Output file name formatting put "%_filename%" (no quotes). More formatting options can be found here.

Your diskwriter preferences should appear as below. Click "Save all".



foobar2000 is now installed and configured for the conversion.

Conversion

Before starting the conversion, check the md5s using md5summer or similar program. All files must be "OK".



Now rename the .md5 file in a way that reflects that it is only associated with the old SHN files. I usually add "shn_" to the beginning of the filename. Do not delete this file. It can be useful as another means to identify which version of the show this is. Do not edit this file other than the filename.

Now you are almost ready to begin conversion. This is a good time to fix spelling mistakes, rename your files to etree format, add a zero before the track numbers 1-9, etc. When you're done, drag and drop all of the SHN files into foobar2000.



Press Ctrl + A to select all files, then right-click on one of the files and select Convert>Run conversion.



A new window will appear with the title "Select file writer preset". FLAC : compression level 8, 4096 bytes padding should be the default setting, if not then select it from the drop-down menu and click "OK".



A progress window will appear. This will take a few minutes.



Bit-compare

When the conversion is finished, select all of the newly-created FLACs and drag and drop them into foobar2000 together with the SHNs which are still there.



At this point you should have the complete SHN and FLAC sets in foobar2000's playlist. Do some simple math... in my example I have 14 SHNs + 14 FLACs = 28 files in foobar2000... yup, we're ready to start. Select all (Ctrl + A), right-click and select "Bit-compare tracks..."



First time you will see some one-time information. Click "OK".



A progress bar will appear, as well as the Console window. Wait a few minutes for it to finish.



Now it's time to check the results:

INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t01.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t01.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t02.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t02.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t03.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t03.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t04.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t04.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t05.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t05.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t06.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t06.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t07.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t07.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t08.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t08.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t09.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t09.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t10.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t10.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t11.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t11.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t12.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t12.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t13.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t13.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.
INFO (foo_bitcompare) : Comparing:
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t14.shn" (0)
INFO (foo_bitcompare) : location: "file://D:\sp1992-09-12.flac16\sp1992-09-12d1t14.flac" (0)
INFO (foo_shn) : cannot find / read external metadata tag file
INFO (foo_shn) : internal seektable will be used.
INFO (foo_bitcompare) : No differences in decoded data found.
INFO (foo_bitcompare) : Finished successfully.


Q: Now, it says that there were no differences found, and I'm cool with that.

The part where it says that it cannot find / read external blah blah blah. No seektable loaded, etc.

Is this cause for concern?

A: No cause for concern here. foo_shn is the SHN decoder plugin for foobar2000. This is just giving you a little feedback about the SHN file:

INFO (foo_shn) : cannot find / read external metadata tag file

This means that there is no .tag file associated with the SHN file. Since SHN does not have any inherant support for tagging, foo_shn can write metadeta to a .tag file. This obviously doesn't have one, but that's fine.

INFO (foo_shn) : cannot find / load external seektable file.

Again, foo_shn is looking for either appended to external seektables. It didn't find any, which means that the SHNs are not seekable (in most other players). The line below that, however, shows just one reason why foobar is the best player out there: it is making up for the lack of a seektable by generating one on the fly so that the end user will never have to worry if the original files were seekable or not.

The foo_bitcompare plugin is just telling you which files it is comparing, and then returns the result that no differences were found. You've successfully completed a SHN > FLAC conversion!

The fastest way to check for errors is to look for the word "ERROR" anywhere on the left-hand side of the log. If you only see the word "INFO", then there were no errors. For an example of what an error looks like, I compared two different files and snapped a pic of the Console window:



Don't rely on your machine "beeping". Mine didn't.

So long as there are no errors, feel free to delete the SHN files now.

Fingerprinting and Updating Lineage

So at this point hopefully you've finished your conversion and have finished a successful verification. Congratulations! There is just a little bit more to do.

FLAC fingerprints: Get FLAC frontend and install it if you haven't already. Drag and drop your new FLAC files into FLAC frontend. It's a nice touch to keep them in the correct order, so grab the set from the first file (circled). Push "Fingerprint".



Save the generated .txt file in the same folder with the FLACs.



If you are feeling paranoid, push the "Test" button to verify your FLACs again using FLAC frontend.

Always include in your lineage how you did to the files what you did. The above example would include:

SHN > foobar2000 0.8.3 (convered and bitverified identical) > FLAC


Note: this will NOT look at, change, or correct any sector boundary issues. If you have SBEs that you need to correct, this needs to be done with shntool. If you run a conversion with FLAC Frontend, there IS an option to correct SBEs, but if the files are in the wrong order in the original window, you're going to have screwed up the entire set.

Feel free to also add tags to your FLAC files:
http://www.thetradersden.org/forums/...ead.php?t=1140

Quote:
Originally Posted by ssamadhi97
SBE checking code for foobar2000

To add file format independent SBE indication to your playlist, append the following code to your playlist formatting string (Preferences -> Display -> Title formatting, Playlist tab):

$ifgreater($mod(%_length_samples%,588),0,$rgb(180,90,90,180,90,90)$num($mod(%_length_samples%,588),3 ),)

The result looks kinda like this:


Tracks with a red number after the playing time have an SBE. For example, in the screenshot above, only the Stolen Ogre tracks have SBEs.


note the nifty PacMan progress bar
__________________
Checksums Demystified | ask for help in Technobabble

thetradersden.org | ttd recommended free software/freeware webring
shntool tlh eac foobar2000 spek audacity cdwave vlc

Quote:
Originally posted by oxymoron
Here you are in a place of permanent madness, be careful!

Last edited by Five; 2005-02-26 at 05:43 AM.
Reply With Quote Reply with Nested Quotes