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

import crash because of replaygain #1592

Closed
Profpatsch opened this issue Sep 7, 2015 · 5 comments
Closed

import crash because of replaygain #1592

Profpatsch opened this issue Sep 7, 2015 · 5 comments

Comments

@Profpatsch
Copy link
Member

I use the Python Audio Tools backend.

Traceback (most recent call last):
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/bin/.beet-wrapped", line 10, in <module>
    load_entry_point('beets==1.3.13', 'console_scripts', 'beet')()
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/lib/python2.7/site-packages/beets/ui/__init__.py", line 1104, in main
    _raw_main(args)
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/lib/python2.7/site-packages/beets/ui/__init__.py", line 1094, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/lib/python2.7/site-packages/beets/ui/commands.py", line 893, in import_func
    import_files(lib, paths, query)
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/lib/python2.7/site-packages/beets/ui/commands.py", line 870, in import_files
    session.run()
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/lib/python2.7/site-packages/beets/importer.py", line 316, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/lib/python2.7/site-packages/beets/util/pipeline.py", line 301, in run
    out = self.coro.send(msg)
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/lib/python2.7/site-packages/beets/util/pipeline.py", line 183, in coro
    func(*(args + (task,)))
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/lib/python2.7/site-packages/beets/importer.py", line 1343, in plugin_stage
    func(session, task)
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/lib/python2.7/site-packages/beets/plugins.py", line 123, in wrapper
    return func(*args, **kwargs)
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/lib/python2.7/site-packages/beetsplug/replaygain.py", line 895, in imported
    self.handle_album(task.album, False)
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/lib/python2.7/site-packages/beetsplug/replaygain.py", line 841, in handle_album
    album_gain = self.backend_instance.compute_album_gain(album)
  File "/nix/store/hpvaypyfqhfysv6i5ynzsci2wmlcbxn9-beets-1.3.13/lib/python2.7/site-packages/beetsplug/replaygain.py", line 731, in compute_album_gain
    rg_track_gain, rg_track_peak = rg.title_gain(audiofile.to_pcm())
ValueError: pcmreader's sample rate doesn't match
@sampsyo
Copy link
Member

sampsyo commented Sep 7, 2015

Thanks! Can you check that the above commit handles this case?

@sampsyo sampsyo closed this as completed in 2140bb2 Sep 7, 2015
@Profpatsch
Copy link
Member Author

Meh, now it crashes at line 743. Maybe wrap that call in a function?

@sampsyo
Copy link
Member

sampsyo commented Sep 8, 2015

Got a traceback?

@Profpatsch
Copy link
Member Author

Traceback (most recent call last):
  File "/nix/store/0jbcwzr22x2p7rn0h9rm9k16zkr40ldj-beets-1.3.13/bin/.beet-wrapped", line 10, in <module>
    load_entry_point('beets==1.3.15', 'console_scripts', 'beet')()
  File "/nix/store/0jbcwzr22x2p7rn0h9rm9k16zkr40ldj-beets-1.3.13/lib/python2.7/site-packages/beets/ui/__init__.py", line 1161, in main
    _raw_main(args)
  File "/nix/store/0jbcwzr22x2p7rn0h9rm9k16zkr40ldj-beets-1.3.13/lib/python2.7/site-packages/beets/ui/__init__.py", line 1151, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/nix/store/0jbcwzr22x2p7rn0h9rm9k16zkr40ldj-beets-1.3.13/lib/python2.7/site-packages/beetsplug/replaygain.py", line 921, in func
    self.handle_album(album, write)
  File "/nix/store/0jbcwzr22x2p7rn0h9rm9k16zkr40ldj-beets-1.3.13/lib/python2.7/site-packages/beetsplug/replaygain.py", line 853, in handle_album
    album_gain = self.backend_instance.compute_album_gain(album)
  File "/nix/store/0jbcwzr22x2p7rn0h9rm9k16zkr40ldj-beets-1.3.13/lib/python2.7/site-packages/beetsplug/replaygain.py", line 743, in compute_album_gain
    rg_track_gain, rg_track_peak = rg.title_gain(audiofile.to_pcm())
ValueError: pcmreader's sample rate doesn't match

@sampsyo
Copy link
Member

sampsyo commented Sep 8, 2015

Thanks! And good idea; I wrapped the title_gain call in a method that handles the exception.

aszlig added a commit to NixOS/nixpkgs that referenced this issue Dec 18, 2015
After trying with a dozen files, it seems the bs1770gain backend is much
more reliable than the audiotools backend and especially does a better
job (well, compared to audiotools which either does doing nothing at all
or throws an exception) when used on alboms that contain different
sample rates/sizes.

Additionally, we already had a few issues regarding the audiotools
backend, even to the extent that @sampsyco almost wanted to drop it
upstream (see sampsyco/beets#1342).

Also related issues are #10376 and beetbox/beets#1592.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants