Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replaygain: Failure using audiotools backend with Python Audio Tools 3.1.1 #3305

Closed
samuelnilsson opened this issue Jun 8, 2019 · 2 comments
Labels
bug bugs that are confirmed and actionable

Comments

@samuelnilsson
Copy link
Contributor

Problem

Running this command in verbose (-vv) mode:

$ beet -vv replaygain --force

Led to this problem:

Sending event: library_opened
replaygain: analyzing Pink Floyd - The Wall - In the Flesh?
Traceback (most recent call last):
  File "/usr/bin/beet", line 11, in <module>
    load_entry_point('beets==1.5.0', 'console_scripts', 'beet')()
  File "/usr/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/ui/__init__.py", line 1267, in main
    _raw_main(args)
  File "/usr/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/ui/__init__.py", line 1254, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beetsplug/replaygain.py", line 1052, in func
    self.handle_track(item, write, force)
  File "/usr/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beetsplug/replaygain.py", line 1003, in handle_track
    track_gains = backend_instance.compute_track_gain([item])
  File "/usr/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beetsplug/replaygain.py", line 752, in compute_track_gain
    return [self._compute_track_gain(item) for item in items]
  File "/usr/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beetsplug/replaygain.py", line 752, in <listcomp>
    return [self._compute_track_gain(item) for item in items]
  File "/usr/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beetsplug/replaygain.py", line 781, in _compute_track_gain
    rg_track_gain, rg_track_peak = self._title_gain(rg, audiofile)
  File "/usr/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beetsplug/replaygain.py", line 764, in _title_gain
    return rg.title_gain(audiofile.to_pcm())
  File "/usr/lib/python3.7/site-packages/audiotools/mp3.py", line 217, in to_pcm
    return MP3Decoder(self.filename)
TypeError: argument 1 must be str, not bytes

Setup

  • OS: Arch Linux 5.1.2-arch1-1-ARCH
  • Python version: 3.7.3
  • beets version: 1.5.0 (master)
  • Turning off plugins made problem go away (yes/no): no (this is a plugin related issue)

My configuration (output of beet config) is:

plugins: replaygain
replaygain:
    backend: audiotools
    overwrite: no
    auto: yes
    targetlevel: 89
    r128: [Opus]
@samuelnilsson
Copy link
Contributor Author

Output from audiotools-config:

Default verbosity level : normal

extraction arguments
  Format Readable Writable Default Quality
  ────── ──────── ──────── ───────────────
    aiff      yes      yes
    alac      yes      yes
      au      yes      yes
    flac      yes      yes               8
     m4a      yes      yes             100
     mp2      yes      yes             192
     mp3      yes      yes               2
     ogg      yes      yes               3
    opus      yes      yes              10
     tta      yes      yes
     wav      yes      yes
      wv      yes      yes        standard

  Format : %(track_number)2.2d - %(track_name)s.%(suffix)s
  Default simultaneous jobs : 1
  Add ReplayGain by default : no

ID3 arguments
    ID3v2 tag version : ID3v2.3
  ID3v2 digit padding : not padded ("1", "2", …)
    ID3v1 tag version : ID3v1.1

CD lookup arguments
     Use MusicBrainz service : no
  Default MusicBrainz server : musicbrainz.org
    Default MusicBrainz port : 80

          Use FreeDB service : no
       Default FreeDB server : us.freedb.org
         Default FreeDB port : 80

system arguments
       Default CD-ROM device : /dev/cdrom
   CD-ROM sample read offset : 0
  CD-ROM sample write offset : 0
    Filesystem text encoding : utf-8
                Audio output : PulseAudio, ALSA, NULL

@sampsyo sampsyo added the bug bugs that are confirmed and actionable label Jun 8, 2019
@sampsyo
Copy link
Member

sampsyo commented Jun 8, 2019

Thanks! Looks like another old library that (incorrectly, IMO) rejects bytestring paths. This is the situation for which we invented the py3_path function. I'll add that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable
Projects
None yet
Development

No branches or pull requests

2 participants