Files
whipper-gui/whipper/program/flac.py
Samantha Baldwin 09de58852e Revert "Convert docstrings to reStructuredText"
This reverts commit 3b1bd242d0.
2018-03-02 16:47:12 -05:00

20 lines
545 B
Python

from subprocess import check_call, CalledProcessError
import logging
logger = logging.getLogger(__name__)
def encode(infile, outfile):
"""
Encodes 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