-fixed some problems with recorder not working on ubuntu 10.10
This commit is contained in:
parent
5b3cd9ea0d
commit
10559a3ff0
|
@ -1,12 +1,15 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
recorder_user="pypo"
|
recorder_user="pypo"
|
||||||
export HOME="/home/pypo/"
|
export HOME="/home/pypo/"
|
||||||
|
export TERM=xterm
|
||||||
# Location of pypo_cli.py Python script
|
# Location of pypo_cli.py Python script
|
||||||
recorder_path="/opt/recorder/bin/"
|
recorder_path="/opt/recorder/bin/"
|
||||||
recorder_script="testrecordscript.py"
|
recorder_script="testrecordscript.py"
|
||||||
echo "*** Daemontools: starting daemon"
|
echo "*** Daemontools: starting daemon"
|
||||||
|
echo $PATH
|
||||||
|
echo $TERM
|
||||||
cd ${recorder_path}
|
cd ${recorder_path}
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
# Note the -u when calling python! we need it to get unbuffered binary stdout and stderr
|
# Note the -u when calling python! we need it to get unbuffered binary stdout and stderr
|
||||||
exec sudo python -u ${recorder_path}${recorder_script} -f
|
python -u ${recorder_path}${recorder_script}
|
||||||
# EOF
|
# EOF
|
||||||
|
|
|
@ -12,7 +12,8 @@ from poster.encode import multipart_encode
|
||||||
from poster.streaminghttp import register_openers
|
from poster.streaminghttp import register_openers
|
||||||
import urllib2
|
import urllib2
|
||||||
|
|
||||||
from subprocess import call
|
#from subprocess import call
|
||||||
|
from subprocess import Popen, PIPE
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
# loading config file
|
# loading config file
|
||||||
|
@ -39,8 +40,10 @@ class Recorder(Thread):
|
||||||
filename = self.filename.replace(" ", "-")
|
filename = self.filename.replace(" ", "-")
|
||||||
filepath = "%s%s.%s" % (config["base_recorded_files"], filename, self.filetype)
|
filepath = "%s%s.%s" % (config["base_recorded_files"], filename, self.filetype)
|
||||||
|
|
||||||
command = "ecasound -i alsa -o %s -t:%s" % (filepath, length)
|
command = ("ecasound -i alsa -o %s -t:%s" % (filepath, length)).split(' ')
|
||||||
call(command, shell=True)
|
print(command)
|
||||||
|
Popen(command, stdout=PIPE)
|
||||||
|
#call(command, shell=False)
|
||||||
|
|
||||||
return filepath
|
return filepath
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue