CC-2268 : Make MP3 optional for show recorder to remove dependency on lame

have changed to default ogg option/choice between mp3|ogg recording in config.
haven't removed any packages from install just incase they affect liquidsoap.
This commit is contained in:
Naomi Aro 2011-12-14 17:59:40 +01:00
parent 29254d49d3
commit 7a607ba98f
3 changed files with 18 additions and 10 deletions

View File

@ -39,7 +39,7 @@ php-pear php5-gd postgresql odbc-postgresql python2.6 libsoundtouch-ocaml \
libtaglib-ocaml libao-ocaml libmad-ocaml ecasound \
libesd0 libportaudio2 libsamplerate0 rabbitmq-server patch \
php5-curl mpg123 monit python-virtualenv multitail libcamomile-ocaml-data \
libvorbis-ocaml libpulse0
libvorbis-ocaml libpulse0 vorbis-tools
#install packages with --force-yes option (this is useful in the case
#of Debian, where these packages are unauthorized)

View File

@ -25,3 +25,6 @@ record_samplerate = 44100
record_channels = 2
record_sample_size = 16
#can be either ogg|mp3, mp3 recording requires installation of the package "lame"
record_file_type = 'ogg'

View File

@ -55,12 +55,11 @@ def getDateTimeObj(time):
class ShowRecorder(Thread):
def __init__ (self, show_instance, show_name, filelength, start_time, filetype):
def __init__ (self, show_instance, show_name, filelength, start_time):
Thread.__init__(self)
self.api_client = api_client.api_client_factory(config)
self.filelength = filelength
self.start_time = start_time
self.filetype = filetype
self.show_instance = show_instance
self.show_name = show_name
self.logger = logging.getLogger('root')
@ -70,7 +69,13 @@ class ShowRecorder(Thread):
length = str(self.filelength)+".0"
filename = self.start_time
filename = filename.replace(" ", "-")
filepath = "%s%s.%s" % (config["base_recorded_files"], filename, self.filetype)
if config["record_file_type"] in ["mp3", "ogg"]:
filetype = config["record_file_type"]
else
filetype = "ogg";
filepath = "%s%s.%s" % (config["base_recorded_files"], filename, filetype)
br = config["record_bitrate"]
sr = config["record_samplerate"]
@ -263,7 +268,7 @@ class CommandListener():
start_time_formatted = '%(year)d-%(month)02d-%(day)02d %(hour)02d:%(min)02d:%(sec)02d' % \
{'year': start_time_on_server.year, 'month': start_time_on_server.month, 'day': start_time_on_server.day,\
'hour': start_time_on_server.hour, 'min': start_time_on_server.minute, 'sec': start_time_on_server.second}
self.sr = ShowRecorder(show_instance, show_name, show_length.seconds, start_time_formatted, filetype="mp3")
self.sr = ShowRecorder(show_instance, show_name, show_length.seconds, start_time_formatted)
self.sr.start()
#remove show from shows to record.