feat(analyzer): analyze replaygain using ffmpeg
- remove pycairo pip install - fix py36 compatibility - reraise when executable was not found BREAKING CHANGE: The analyzer requires 'ffmpeg'. The 'rgain3' python package and it's system dependencies can be removed.
This commit is contained in:
parent
bf7b0d44fb
commit
ceab19271d
8 changed files with 141 additions and 77 deletions
24
analyzer/libretime_analyzer/utils.py
Normal file
24
analyzer/libretime_analyzer/utils.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from subprocess import PIPE, CalledProcessError, CompletedProcess, run
|
||||
|
||||
from loguru import logger
|
||||
|
||||
|
||||
def run_(*args, **kwargs) -> CompletedProcess:
|
||||
try:
|
||||
return run(
|
||||
args,
|
||||
check=True,
|
||||
stdout=PIPE,
|
||||
stderr=PIPE,
|
||||
universal_newlines=True,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
except OSError as exception: # executable was not found
|
||||
cmd = args[0]
|
||||
logger.warning(f"Failed to run: {cmd} - {exception}. Is {cmd} installed?")
|
||||
raise exception
|
||||
|
||||
except CalledProcessError as exception: # returned an error code
|
||||
logger.error(exception)
|
||||
raise exception
|
Loading…
Add table
Add a link
Reference in a new issue