diff options
author | Walter Bender <walter.bender@gmail.com> | 2012-05-24 19:37:56 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2012-05-24 19:37:56 (GMT) |
commit | 4fc241db03e2cae6a5f199bf7982aa02d8759075 (patch) | |
tree | f44f5007ec9a1f27c7eb869e329fbbaa06b4180c | |
parent | 6ce9b04a711f4a5cec8893471689d6ffbeec54d6 (diff) |
fall back to gst-launch-10 if gst-launch not found
-rw-r--r-- | play_audio.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/play_audio.py b/play_audio.py index 2ed445b..bbcce0c 100644 --- a/play_audio.py +++ b/play_audio.py @@ -30,5 +30,15 @@ def play_audio_from_file(parent, file_path): command_line = ['gst-launch', 'filesrc', 'location=' + file_path, '! oggdemux', '! vorbisdec', '! audioconvert', '! alsasink'] - subprocess.call(command_line) + try: + subprocess.call(command_line) + except: + try: + command_line = ['gst-launch-10', 'filesrc', + 'location=' + file_path, + '! oggdemux', '! vorbisdec', '! audioconvert', + '! alsasink'] + subprocess.call(command_line) + except: + pass |