Skip to content

Commit

Permalink
guess AAC codec. If list fails, use aac anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian-Robert Stöter committed Dec 20, 2017
1 parent 51283fc commit 9051bcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/check_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

if __name__ == '__main__':
# read stems
Info = stempeg.check_available_codecs()
Info = stempeg.check_available_aac_encoders()
print(Info)
10 changes: 6 additions & 4 deletions stempeg/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def check_available_aac_encoders():
"""Extracts FFMPEG info and returns info as json
"""Returns the available AAC encoders
Returns
----------
Expand All @@ -27,9 +27,11 @@ def check_available_aac_encoders():
output.splitlines() if "AAC (Advanced Audio Coding)" in str(x)
][0]
hay = aac_codecs.decode('ascii')
codec_list = re.findall('\(encoders: ([^\)]*) \)', hay)[0].split(" ")

return codec_list
match = re.findall('\(encoders: ([^\)]*) \)', hay)
if match is not None:
return match[0].split(" ")
else:
return None


def write_stems(
Expand Down

0 comments on commit 9051bcb

Please sign in to comment.