Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/play_audio.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-10-04 21:56:01 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-10-04 21:56:01 (GMT)
commit47f02bdae7d97a1d2aaf1a7666630232f7b54d93 (patch)
treef872a70cd3aed2cac2c4d1c53592edefb4497fa4 /play_audio.py
parentc088088b47e2341fbf1ec367ecf035a0f6af6324 (diff)
add audio; refine easter egg trigger
Diffstat (limited to 'play_audio.py')
-rw-r--r--play_audio.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/play_audio.py b/play_audio.py
new file mode 100644
index 0000000..2ed445b
--- /dev/null
+++ b/play_audio.py
@@ -0,0 +1,34 @@
+"""
+ aplay.py
+ refactored based on Jukebox Activity
+ Copyright (C) 2007 Andy Wingo <wingo@pobox.com>
+ Copyright (C) 2007 Red Hat, Inc.
+ Copyright (C) 2008-2010 Kushal Das <kushal@fedoraproject.org>
+ Copyright (C) 2010-11 Walter Bender
+"""
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+
+
+import subprocess
+
+def play_audio_from_file(parent, file_path):
+ """ Audio media """
+ command_line = ['gst-launch', 'filesrc', 'location=' + file_path,
+ '! oggdemux', '! vorbisdec', '! audioconvert',
+ '! alsasink']
+ subprocess.call(command_line)
+