2022-02-06 15:20:12 +00:00
|
|
|
from ..types import File
|
|
|
|
from ..meta import r128gain_path, ffmpeg_path
|
|
|
|
|
|
|
|
from subprocess import run as run_command
|
|
|
|
|
2022-02-06 15:51:42 +00:00
|
|
|
def do_replaygain(file: File, skip_if_existing: bool = True) -> None:
|
|
|
|
command_args = [
|
2022-02-06 15:20:12 +00:00
|
|
|
r128gain_path,
|
|
|
|
"-f", ffmpeg_path,
|
2022-02-06 15:51:42 +00:00
|
|
|
"-v", "warning",
|
2022-02-06 15:20:12 +00:00
|
|
|
file.join_path_to()
|
2022-02-06 15:51:42 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
if skip_if_existing:
|
|
|
|
command_args.append("-s")
|
|
|
|
run_command(command_args)
|