From 41ff024760a9ce102e04e081950f9c03284cd0a7 Mon Sep 17 00:00:00 2001 From: yomguy <> Date: Sun, 18 Jul 2010 23:02:18 +0000 Subject: [PATCH] add 1 stream to deefuzzer -> 1 local + 1 distant (record on local by default) --- conf/etc/telecaster/deefuzzer.xml | 61 +++++++++++++++++++++++++++++-- station.py | 52 ++++++++++++++++++-------- 2 files changed, 94 insertions(+), 19 deletions(-) diff --git a/conf/etc/telecaster/deefuzzer.xml b/conf/etc/telecaster/deefuzzer.xml index b078f62..077f197 100644 --- a/conf/etc/telecaster/deefuzzer.xml +++ b/conf/etc/telecaster/deefuzzer.xml @@ -4,7 +4,61 @@ - telecaster_04 + telecaster_local + TeleCaster LocalHost + TeleCaster local audio streaming + http://crfpa.pre-barreau.com + Vocal + + + 127.0.0.1 + 8000 + source2parisson + 0 + + + /path/to/mp3 + mp3 + 96 + 7 + 44100 + 2 + 1 + + + /var/www/rss + 0 + + + 0 + my_twitter_user + my_twitter_password + bla bla + + + 0 + /path/to/jingles + 1 + + + 1 + 1234 + + + 1 + http://localhost:8000/telecaster_live.mp3 + Parisson + + + 1 + /path/to/archives + + + + + + + telecaster TeleCaster #4 TeleCaster testing http://crfpa.pre-barreau.com @@ -41,8 +95,8 @@ 1 - 1 - 1234 + 0 + 1235 1 @@ -55,6 +109,7 @@ + diff --git a/station.py b/station.py index 0b62afd..6bf3426 100644 --- a/station.py +++ b/station.py @@ -133,22 +133,42 @@ class Station(Conference): else: self.jack_inputs.append(jack_inputs['name']) + # DeeFuzzzer setup self.deefuzzer_dict = xml2dict(self.deefuzzer_default_conf_file) - self.deefuzzer_dict['deefuzzer']['station']['infos']['short_name'] = self.mount_point - self.deefuzzer_dict['deefuzzer']['station']['infos']['name'] = self.ServerName - self.deefuzzer_dict['deefuzzer']['station']['infos']['description'] = self.ServerDescription.replace(' ','_') - self.deefuzzer_dict['deefuzzer']['station']['infos']['genre'] = self.genre - self.deefuzzer_dict['deefuzzer']['station']['server']['host'] = self.host - self.deefuzzer_dict['deefuzzer']['station']['server']['port'] = self.port - self.deefuzzer_dict['deefuzzer']['station']['server']['sourcepassword'] = self.password - self.deefuzzer_dict['deefuzzer']['station']['media']['bitrate'] = self.bitrate - self.deefuzzer_dict['deefuzzer']['station']['media']['dir'] = self.play_dir - self.deefuzzer_dict['deefuzzer']['station']['media']['voices'] = str(len(self.jack_inputs)) - self.deefuzzer_dict['deefuzzer']['station']['record']['mode'] = '1' - self.deefuzzer_dict['deefuzzer']['station']['record']['dir'] = self.file_dir - self.deefuzzer_dict['deefuzzer']['station']['relay']['mode'] = '1' - self.deefuzzer_dict['deefuzzer']['station']['relay']['author'] = self.professor - self.deefuzzer_port = self.deefuzzer_dict['deefuzzer']['station']['control']['port'] + self.station_local = self.deefuzzer_dict['deefuzzer']['station'][0] + self.station_distant = self.deefuzzer_dict['deefuzzer']['station'][1] + + self.station_local['infos']['short_name'] = self.mount_point + self.station_local['infos']['name'] = self.ServerName + self.station_local['infos']['description'] = self.ServerDescription.replace(' ','_') + self.station_local['infos']['genre'] = self.genre + self.station_local['server']['host'] = '127.0.0.1' + self.station_local['server']['port'] = self.port + self.station_local['server']['sourcepassword'] = self.password + self.station_local['media']['bitrate'] = self.bitrate + self.station_local['media']['dir'] = self.play_dir + self.station_local['media']['voices'] = str(len(self.jack_inputs)) + self.station_local['record']['mode'] = '1' + self.station_local['record']['dir'] = self.file_dir + self.station_local['relay']['mode'] = '1' + self.station_local['relay']['author'] = self.professor + + self.station_distant['infos']['short_name'] = self.mount_point + self.station_distant['infos']['name'] = self.ServerName + self.station_distant['infos']['description'] = self.ServerDescription.replace(' ','_') + self.station_distant['infos']['genre'] = self.genre + self.station_distant['server']['host'] = self.host + self.station_distant['server']['port'] = self.port + self.station_distant['server']['sourcepassword'] = self.password + self.station_distant['media']['bitrate'] = self.bitrate + self.station_distant['media']['dir'] = self.play_dir + self.station_distant['media']['voices'] = str(len(self.jack_inputs)) + self.station_distant['record']['mode'] = '0' + self.station_distant['record']['dir'] = self.file_dir + self.station_distant['relay']['mode'] = '1' + self.station_distant['relay']['author'] = self.professor + + self.deefuzzer_local_port = self.station_local['control']['port'] self.deefuzzer_xml = dicttoxml(self.deefuzzer_dict) def write_deefuzzer_conf(self): @@ -176,7 +196,7 @@ class Station(Conference): def stop_rec(self): if len(self.deefuzzer_pid) != 0: - target = liblo.Address(self.deefuzzer_port) + target = liblo.Address(self.deefuzzer_local_port) liblo.send(target, "/record", 0) def mp3_convert(self): -- 2.39.5