CC-2590 : Make bitrate for liquidsoap and show-recorder adjustable from the config file

This commit is contained in:
Naomi Aro 2011-07-26 16:21:20 +02:00
parent 1366b159f2
commit f0bf7c00c3
4 changed files with 58 additions and 38 deletions

View File

@ -10,6 +10,10 @@ output_icecast_vorbis = true
output_icecast_mp3 = false
output_shoutcast = false
output_bitrate = 128
output_samplerate = 44100
output_stereo = true
###########################################
# Logging settings #
###########################################

View File

@ -57,7 +57,9 @@ if output_sound_device then
end
if output_icecast_mp3 then
ignore(output.icecast(%mp3,
#%mp3(bitrate=32, samplerate=22050, stereo=false)
ignore(output.icecast(%mp3(bitrate=output_bitrate, samplerate=output_samplerate, stereo=output_stereo),
host = icecast_host,
port = icecast_port,
password = icecast_pass,
@ -74,7 +76,7 @@ end
if output_icecast_vorbis then
if output_icecast_vorbis_metadata then
ignore(output.icecast(%vorbis,
ignore(output.icecast(%vorbis(bitrate=output_bitrate, samplerate=output_samplerate, stereo=output_stereo),
host = icecast_host,
port = icecast_port,
password = icecast_pass,
@ -91,7 +93,7 @@ if output_icecast_vorbis then
#remove metadata from ogg source and merge tracks to fix bug
#with vlc and mplayer disconnecting at the end of every track
s = add(normalize=false, [amplify(0.00001, noise()),s])
ignore(output.icecast(%vorbis,
ignore(output.icecast(%vorbis(bitrate=output_bitrate, samplerate=output_samplerate, stereo=output_stereo),
host = icecast_host,
port = icecast_port,
password = icecast_pass,
@ -108,7 +110,7 @@ if output_icecast_vorbis then
end
if output_shoutcast then
ignore(output.shoutcast(%mp3,
ignore(output.shoutcast(%mp3(bitrate=output_bitrate, samplerate=output_samplerate, stereo=output_stereo),
host = shoutcast_host,
port = shoutcast_port,
password = shoutcast_pass,

View File

@ -16,3 +16,11 @@ rabbitmq_host = 'localhost'
rabbitmq_user = 'guest'
rabbitmq_password = 'guest'
############################################
# Recorded Audio settings #
############################################
record_bitrate = 128
record_samplerate = 44100
record_channels = 2
record_sample_size = 16

View File

@ -68,8 +68,14 @@ class ShowRecorder(Thread):
filename = filename.replace(" ", "-")
filepath = "%s%s.%s" % (config["base_recorded_files"], filename, self.filetype)
command = "ecasound -i alsa -o %s -t:%s" % (filepath, length)
#-ge:0.1,0.1,0,-1
br = config["record_bitrate"]
sr = config["record_samplerate"]
c = config["record_channels"]
ss = config["record_sample_size"]
#-f:16,2,44100
#-b:256
command = "ecasound -f:%s,%s,%s -b:%s -i alsa -o %s -t:%s" % (ss, c, sr, br, filepath, length)
args = command.split(" ")
self.logger.info("starting record")