CC-2590 : Make bitrate for liquidsoap and show-recorder adjustable from the config file
This commit is contained in:
parent
1366b159f2
commit
f0bf7c00c3
4 changed files with 58 additions and 38 deletions
|
@ -10,6 +10,10 @@ output_icecast_vorbis = true
|
||||||
output_icecast_mp3 = false
|
output_icecast_mp3 = false
|
||||||
output_shoutcast = false
|
output_shoutcast = false
|
||||||
|
|
||||||
|
output_bitrate = 128
|
||||||
|
output_samplerate = 44100
|
||||||
|
output_stereo = true
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
# Logging settings #
|
# Logging settings #
|
||||||
###########################################
|
###########################################
|
||||||
|
|
|
@ -57,7 +57,9 @@ if output_sound_device then
|
||||||
end
|
end
|
||||||
|
|
||||||
if output_icecast_mp3 then
|
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,
|
host = icecast_host,
|
||||||
port = icecast_port,
|
port = icecast_port,
|
||||||
password = icecast_pass,
|
password = icecast_pass,
|
||||||
|
@ -74,7 +76,7 @@ end
|
||||||
|
|
||||||
if output_icecast_vorbis then
|
if output_icecast_vorbis then
|
||||||
if output_icecast_vorbis_metadata 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,
|
host = icecast_host,
|
||||||
port = icecast_port,
|
port = icecast_port,
|
||||||
password = icecast_pass,
|
password = icecast_pass,
|
||||||
|
@ -91,7 +93,7 @@ if output_icecast_vorbis then
|
||||||
#remove metadata from ogg source and merge tracks to fix bug
|
#remove metadata from ogg source and merge tracks to fix bug
|
||||||
#with vlc and mplayer disconnecting at the end of every track
|
#with vlc and mplayer disconnecting at the end of every track
|
||||||
s = add(normalize=false, [amplify(0.00001, noise()),s])
|
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,
|
host = icecast_host,
|
||||||
port = icecast_port,
|
port = icecast_port,
|
||||||
password = icecast_pass,
|
password = icecast_pass,
|
||||||
|
@ -108,7 +110,7 @@ if output_icecast_vorbis then
|
||||||
end
|
end
|
||||||
|
|
||||||
if output_shoutcast then
|
if output_shoutcast then
|
||||||
ignore(output.shoutcast(%mp3,
|
ignore(output.shoutcast(%mp3(bitrate=output_bitrate, samplerate=output_samplerate, stereo=output_stereo),
|
||||||
host = shoutcast_host,
|
host = shoutcast_host,
|
||||||
port = shoutcast_port,
|
port = shoutcast_port,
|
||||||
password = shoutcast_pass,
|
password = shoutcast_pass,
|
||||||
|
|
|
@ -16,3 +16,11 @@ rabbitmq_host = 'localhost'
|
||||||
rabbitmq_user = 'guest'
|
rabbitmq_user = 'guest'
|
||||||
rabbitmq_password = 'guest'
|
rabbitmq_password = 'guest'
|
||||||
|
|
||||||
|
############################################
|
||||||
|
# Recorded Audio settings #
|
||||||
|
############################################
|
||||||
|
record_bitrate = 128
|
||||||
|
record_samplerate = 44100
|
||||||
|
record_channels = 2
|
||||||
|
record_sample_size = 16
|
||||||
|
|
||||||
|
|
|
@ -68,8 +68,14 @@ class ShowRecorder(Thread):
|
||||||
filename = filename.replace(" ", "-")
|
filename = 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)
|
br = config["record_bitrate"]
|
||||||
#-ge:0.1,0.1,0,-1
|
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(" ")
|
args = command.split(" ")
|
||||||
|
|
||||||
self.logger.info("starting record")
|
self.logger.info("starting record")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue