Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-05-15 13:29:26 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-05-15 13:29:26 (GMT)
commit0a8b168a8a28f560df6a32a41dc353fd322b3152 (patch)
treef7302265f311f203871954e5f9deb752557f11b0 /utils.py
parent744acc9aff955d1d0eb52a926a0096269b2e9159 (diff)
add audio record/playback
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/utils.py b/utils.py
index ffab831..230ab45 100644
--- a/utils.py
+++ b/utils.py
@@ -9,7 +9,7 @@
# along with this library; if not, write to the Free Software
# Foundation, 51 Franklin Street, Suite 500 Boston, MA 02110-1335 USA
-
+import subprocess
from StringIO import StringIO
try:
OLD_SUGAR_SYSTEM = False
@@ -51,3 +51,11 @@ def json_dump(data):
_io = StringIO()
jdump(data, _io)
return _io.getvalue()
+
+
+def play_audio_from_file(file_path):
+ """ Audio media """
+ command_line = ['gst-launch', 'filesrc', 'location=' + file_path,
+ '! oggdemux', '! vorbisdec', '! audioconvert',
+ '! alsasink']
+ subprocess.call(command_line)