tuffy / python-audio-tools

A collection of audio handling programs which work from the command line.
http://audiotools.sourceforge.net
GNU General Public License v2.0
249 stars 58 forks source link

Trackverify -R fails #43

Closed remenor closed 9 years ago

remenor commented 9 years ago

Python Audio Tools 3.0beta1

AccurateRip verification does not work well with python2. Started well but the final report fails:

[ 1/13]  01. filename.flac : found (confidence 6)
[...]
[13/13]  13. filename.flac : found (confidence 6)
Traceback (most recent call last):
  File "/usr/local/bin/trackverify", line 647, in <module>
    filename = audiotools.output_text(filename)
  File "/usr/local/lib/python2.7/dist-packages/audiotools/__init__.py", line 528, in __new__
    assert(isinstance(unicode_string, str if PY3 else unicode))
AssertionError

Also after converting the tracks, verification fails completely

[ 1/13]  track01.wav : disc not in database
[ 2/13]  track02.wav : no match in database
[...]
[13/13]  track13.wav : no match in database
Traceback (most recent call last):
  File "/usr/local/bin/trackverify", line 647, in <module>
    filename = audiotools.output_text(filename)
  File "/usr/local/lib/python2.7/dist-packages/audiotools/__init__.py", line 528, in __new__
    assert(isinstance(unicode_string, str if PY3 else unicode))
AssertionError

After installing python3-dev (and edit the makefile), verification (original) works as it should:

                                 AccurateRip V1             AccurateRip V2
Track                      Confidence Offset Checksum Confidence Offset Checksum
────────────────────────── ────────── ────── ──────── ────────── ────── ────────
01. filename.flac                   8      0 C923A50C          6      0 D28F1820
02. filename.flac                   8      0 A1F577F6          6      0 D650C147
[...]
13. filename.flac                   7      0 43F4A3CE          6      0 C69E2866

But the verification of the converted files keeps failing:

[ 1/13]  track01.wav : disc not in database
[...]
[13/13]  track13.wav : no match in database
                                  AccurateRip V1             AccurateRip V2
Track       Confidence Offset Checksum Confidence Offset Checksum
─────────── ────────── ────── ──────── ────────── ────── ────────
track01.wav                 0 C923A50C                 0 D28F1820
track02.wav                 0 A1F577F6                 0 D650C147
[...]
track13.wav                 0 43F4A3CE                 0 C69E2866

So, although the checksums are identical. Thanks! Sorry for my english

tuffy commented 9 years ago

I've pushed out fixes for both the AssertionError under Python 2.7 and the trackverify bug when files have no embedded track numbers.

Hopefully it will work better now!

remenor commented 9 years ago

Thanks! Verification (for track) works perfectly. But there is an error when trying to verify an image + cue:

Traceback (most recent call last):
  File "/usr/local/bin/trackverify", line 602, in <module>
    results = queue.run(options.max_processes)
  File "/usr/local/lib/python2.7/dist-packages/audiotools/__init__.py", line 5359, in run
    return self.__run_serial__()
  File "/usr/local/lib/python2.7/dist-packages/audiotools/__init__.py", line 5397, in __run_serial__
    output = completion_output(result)
  File "/usr/local/bin/trackverify", line 338, in accuraterip_display_result
    path = audiotools.Filename(result["filename"])
  File "/usr/local/lib/python2.7/dist-packages/audiotools/__init__.py", line 1795, in __new__
    assert(isinstance(filename, str))
AssertionError

The error occurs only with python2.7. With python3.4 works perfectly. Maybe it would be easier to change the code directly to python 3? Thanks! Sorry for my english

tuffy commented 9 years ago

I've pushed out a new fix which should hopefully handle the cuesheet case properly also.

Though it would be easier to just support Python 3, there's still a lot of people with systems that don't come with it by default (like OS X). So I'll continue to try to support both for as long as I need to.

remenor commented 9 years ago

Thanks! works perfectly