Skip to content

Commit

Permalink
change subprocess function from run to getoutput
Browse files Browse the repository at this point in the history
  • Loading branch information
AppleHolic committed Nov 28, 2019
1 parent 8acff8d commit 7bb90d2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions demucs/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@


def _read_info(path):
process = sp.run(
['ffprobe', str(path), '-print_format', 'json', '-show_format', '-show_streams'],
capture_output=True,
check=True)
return json.loads(process.stdout.decode('utf-8'))
stdout_data = sp.getoutput('ffprobe {} -print_format json -show_format -show_streams'.format(str(path)))
return json.loads(stdout_data[stdout_data.index('{\n'):])


class AudioFile:
Expand Down

0 comments on commit 7bb90d2

Please sign in to comment.