Files
whipper-gui/whipper/program/flac.py
JoeLametta e56c636fd3 Improve docstrings
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2020-02-22 15:11:22 +00:00

21 lines
547 B
Python

from subprocess import check_call, CalledProcessError
import logging
logger = logging.getLogger(__name__)
def encode(infile, outfile):
"""
Encode infile to outfile, with flac.
Uses ``-f`` because whipper already creates the file.
"""
try:
# TODO: Replace with Popen so that we can catch stderr and write it to
# logging
check_call(['flac', '--silent', '--verify', '-o', outfile,
'-f', infile])
except CalledProcessError:
logger.exception('flac failed')
raise