cmcginty / flacsync

Recursively mirror a directory tree of FLAC audio files to AAC or OGG.
http://packages.python.org/flacsync/
Other
30 stars 8 forks source link

Faulty flac files should be handled better #4

Open svalgaard opened 11 years ago

svalgaard commented 11 years ago

If you have faulty FLAC files (as I unfortunately have), flacsync simply stops in the middle of the file, and leaves a partial aac file. flacsync should either not create an aac file or try to decode the entire file if possible (using -F).

e.g., for a 10:00 flac file with an error 2 minutes inside the file, you get a 2 minute aac file.

adding -F looks like the easiest solution (and the best in many cases). This can be done by adding -F in encoder.py approx line 131:

    # encode to AAC                                                                                                                                                                                
     err = sp.call( 'flac -d "%s" -c -s -F | neroAacEnc -q %s -if - -of "%s"' %
       (self.src, self.q, self.dst), shell=True, stderr=NULL)

Cheers,

Jens

cmcginty commented 11 years ago

Thanks for the report. I'll try and address this soon.

On Wed, Jan 30, 2013 at 9:26 AM, Jens Svalgaard Kohrt < notifications@github.com> wrote:

If you have faulty FLAC files (as I unfortunately have), flacsync simply stops in the middle of the file, and leaves a partial aac file. flacsync should either not create an aac file or try to decode the entire file if possible (using -F).

e.g., for a 10:00 flac file with an error 2 minutes inside the file, you get a 2 minute aac file.

adding -F looks like the easiest solution (and the best in many cases). This can be done by adding -F in encoder.py approx line 131:

# encode to AAC
 err = sp.call( 'flac -d "%s" -c -s -F | neroAacEnc -q %s -if - -of "%s"' %
   (self.src, self.q, self.dst), shell=True, stderr=NULL)

Cheers,

Jens

— Reply to this email directly or view it on GitHubhttps://github.com/cmcginty/flacsync/issues/4.

svalgaard commented 11 years ago

Thanks. Let me know if you need a test Flac file. Though I guess that you could create one by simply changing a byte somewhere in the middle af any flac file... :)