diff options
author | Tony Anderson <tony@traveler.(none)> | 2011-03-15 10:51:19 (GMT) |
---|---|---|
committer | Tony Anderson <tony@traveler.(none)> | 2011-03-15 10:51:19 (GMT) |
commit | 6da020e2c23ad617b7dee02845c1d94e9935f71c (patch) | |
tree | 1233700e7cadd4f67a0edbad568a03516287e092 | |
parent | b5bb0c4dca541e82336dbeea63cf07851f889ff4 (diff) |
version 12.6
-rwxr-xr-x | activity/activity.info | 2 | ||||
-rwxr-xr-x | cgi-bin/activities.py | 2 | ||||
-rwxr-xr-x | cgi-bin/record.py | 30 | ||||
-rwxr-xr-x | cgi-bin/setConfig.py | 17 |
4 files changed, 32 insertions, 19 deletions
diff --git a/activity/activity.info b/activity/activity.info index a78228e..28aec40 100755 --- a/activity/activity.info +++ b/activity/activity.info @@ -1,5 +1,5 @@ [Activity] -#version = 12.5 +#version = 12.6 name = Learn service_name = rw.olpc.Learn icon = activity-learn diff --git a/cgi-bin/activities.py b/cgi-bin/activities.py index 8a36e79..ea740cc 100755 --- a/cgi-bin/activities.py +++ b/cgi-bin/activities.py @@ -160,7 +160,7 @@ def getSubjects(): else: #get from schoolserver folder = 'content/' pth = SS - script = 'cd ' + str(pth) + '\nget subjects.js\nget index.html' + script = 'cd ' + str(pth) + '\nget subjects.js\nget index.html\nmget version-*' (result,err) = sftp(script, folder) def getKarma(): diff --git a/cgi-bin/record.py b/cgi-bin/record.py new file mode 100755 index 0000000..6d43e71 --- /dev/null +++ b/cgi-bin/record.py @@ -0,0 +1,30 @@ +#!/usr/bin/python +import os, sys, subprocess +import cgi, cgitb +from path import path +cgitb.enable(display=True) +AUDIOPATH = '/tmp/audio.wav' + +# Start Recording +def record(filename): + if not filename : + #we are recording, stop and save clip + subprocess.call("killall -q arecord", shell=True) + #convert to ogg file + #initialize convert pipeline + pipeline = "filesrc location=" + AUDIOPATH + " ! wavparse " + pipeline += "! audioconvert ! vorbisenc ! oggmux " + pipeline += "! filesink location=" + pipeline += filename + subprocess.call("gst-launch-0.10 " + pipeline, shell=True) + #reset mic boost + subprocess.call("amixer cset numid=11 off", shell = True)() + else: + #turn on mic boost (xo) + subprocess.call("amixer cset numid=11 on", shell=True) + pid=subprocess.Popen("arecord -f cd " + AUDIOPATH, shell=True) + +print 'Content-Type:text/html\n\n' +form = cgi.FieldStorage() +f = form.getfirst('filename') +record(f) diff --git a/cgi-bin/setConfig.py b/cgi-bin/setConfig.py deleted file mode 100755 index 5c820cb..0000000 --- a/cgi-bin/setConfig.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/python -import os, sys, subprocess -import cgi, cgitb -from path import path -from activities import Config -cgitb.enable(display=True) -log = open('/tmp/logConfig','w') -print >> log,'logConfig open' -print 'Content-Type:text/html\n\n' -form = cgi.FieldStorage() -config = Config() -key = form.getfirst('key') -value = form.getfirst('value') -print >> log, 'key',key,'value',value -config.setConfig(key,value) -config.saveConfig() -log.close() |