Commit 9d38e17b authored by david's avatar david
Browse files

Remove unused recorder fragments. #59

parent 6c88c93f
......@@ -199,68 +199,6 @@ frame_duration=""
# frame_size => int
frame_size=""
#####################
# Recorder Settings #
#####################
# you can define up to 5 recorder types.
# flac, mp3, ogg, opus and wav is supported
[recording]
# flac example
# enable this recorder. everything else than 'y' is considered as disabled
rec_0="n"
# first set a folder
rec_0_folder="/var/recordings/flac"
# after how many minutes the recording will be cut
rec_0_duration="30"
# file (or encoding-) type
rec_0_encoding="flac"
# bitrate (with encoding types without bitrate like flac or wav it is substituted. 32 => very poor quality. 320 => very high quality)
rec_0_bitrate="128"
# channels: everything else than 2 is considered as mono
rec_0_channels="2"
# mp3 example
rec_1="n"
rec_1_folder="/var/audio/rec/mp3"
rec_1_duration="30"
rec_1_encoding="mp3"
rec_1_bitrate="320"
rec_1_channels="2"
# mp3 example
rec_2="n"
rec_2_folder="/var/audio/rec/mp3"
rec_2_duration="30"
rec_2_encoding="mp3"
rec_2_bitrate="192"
rec_2_channels="2"
# ogg example
rec_3="n"
rec_3_folder="/var/recordings/ogg"
rec_3_duration="30"
rec_3_encoding="ogg"
rec_3_bitrate="320"
rec_3_channels="2"
# opus example
rec_4="n"
rec_4_folder="/var/recordings/opus"
rec_4_duration="30"
rec_4_encoding="opus"
rec_4_bitrate="32"
rec_4_channels="2"
# wav example
#rec_4="n"
#rec_4_folder="/var/recordings/wav"
#rec_4_duration="30"
#rec_4_filetype="wav"
#rec_4_bitrate="320"
#rec_4_channels="2"
###################
# Stream Settings #
###################
......
......@@ -198,68 +198,6 @@ frame_duration=""
# frame_size => int
frame_size=""
#####################
# Recorder Settings #
#####################
# you can define up to 5 recorder types.
# flac, mp3, ogg, opus and wav is supported
[recording]
# flac example
# enable this recorder. everything else than 'y' is considered as disabled
rec_0="n"
# first set a folder
rec_0_folder="/var/recordings/flac"
# after how many minutes the recording will be cut
rec_0_duration="30"
# file (or encoding-) type
rec_0_encoding="flac"
# bitrate (with encoding types without bitrate like flac or wav it is substituted. 32 => very poor quality. 320 => very high quality)
rec_0_bitrate="128"
# channels: everything else than 2 is considered as mono
rec_0_channels="2"
# mp3 example
rec_1="n"
rec_1_folder="/var/audio/rec/mp3"
rec_1_duration="30"
rec_1_encoding="mp3"
rec_1_bitrate="320"
rec_1_channels="2"
# mp3 example
rec_2="n"
rec_2_folder="/var/audio/rec/mp3"
rec_2_duration="30"
rec_2_encoding="mp3"
rec_2_bitrate="192"
rec_2_channels="2"
# ogg example
rec_3="n"
rec_3_folder="/var/recordings/ogg"
rec_3_duration="30"
rec_3_encoding="ogg"
rec_3_bitrate="320"
rec_3_channels="2"
# opus example
rec_4="n"
rec_4_folder="/var/recordings/opus"
rec_4_duration="30"
rec_4_encoding="opus"
rec_4_bitrate="32"
rec_4_channels="2"
# wav example
#rec_4="n"
#rec_4_folder="/var/recordings/wav"
#rec_4_duration="30"
#rec_4_filetype="wav"
#rec_4_bitrate="320"
#rec_4_channels="2"
###################
# Stream Settings #
###################
......
......@@ -198,68 +198,6 @@ frame_duration=""
# frame_size => int
frame_size=""
#####################
# Recorder Settings #
#####################
# you can define up to 5 recorder types.
# flac, mp3, ogg, opus and wav is supported
[recording]
# flac example
# enable this recorder. everything else than 'y' is considered as disabled
rec_0="n"
# first set a folder
rec_0_folder="/var/recordings/flac"
# after how many minutes the recording will be cut
rec_0_duration="30"
# file (or encoding-) type
rec_0_encoding="flac"
# bitrate (with encoding types without bitrate like flac or wav it is substituted. 32 => very poor quality. 320 => very high quality)
rec_0_bitrate="128"
# channels: everything else than 2 is considered as mono
rec_0_channels="2"
# mp3 example
rec_1="n"
rec_1_folder="/var/audio/rec/mp3"
rec_1_duration="30"
rec_1_encoding="mp3"
rec_1_bitrate="320"
rec_1_channels="2"
# mp3 example
rec_2="n"
rec_2_folder="/var/audio/rec/mp3"
rec_2_duration="30"
rec_2_encoding="mp3"
rec_2_bitrate="192"
rec_2_channels="2"
# ogg example
rec_3="n"
rec_3_folder="/var/recordings/ogg"
rec_3_duration="30"
rec_3_encoding="ogg"
rec_3_bitrate="320"
rec_3_channels="2"
# opus example
rec_4="n"
rec_4_folder="/var/recordings/opus"
rec_4_duration="30"
rec_4_encoding="opus"
rec_4_bitrate="32"
rec_4_channels="2"
# wav example
#rec_4="n"
#rec_4_folder="/var/recordings/wav"
#rec_4_duration="30"
#rec_4_filetype="wav"
#rec_4_bitrate="320"
#rec_4_channels="2"
###################
# Stream Settings #
###################
......
......@@ -24,7 +24,7 @@ This page gives a more detailed overview of the Aura Engine features and how to
## Multi-channel Input (Filesystem, Stream, Analog)
It's possible to schedules playlists with music or pre-recorded show stored on the **filessystem**,
It's possible to schedules playlists with music or pre-recorded show stored on the **file system**,
via external **streams** or live from an **analog input** in the studio. All types of sources can
be mixed in a single playlist.
......
......@@ -71,13 +71,10 @@ class PlayerConnector():
lqs_instance = self.client
try:
if not self.disable_logging:
if namespace == "recorder":
self.logger.debug("LiquidSoapCommunicator is calling " + str(namespace) + "_" + str(command) + "." + str(args))
if command == "":
self.logger.debug("LiquidSoapCommunicator is calling " + str(namespace) + str(args))
else:
if command == "":
self.logger.debug("LiquidSoapCommunicator is calling " + str(namespace) + str(args))
else:
self.logger.debug("LiquidSoapCommunicator is calling " + str(namespace) + "." + str(command) + str(args))
self.logger.debug("LiquidSoapCommunicator is calling " + str(namespace) + "." + str(command) + str(args))
# call wanted function ...
......
......@@ -283,47 +283,6 @@ class LiquidSoapPlayerClient(LiquidSoapClient):
return self.message
# ------------------------------------------------------------------------------------------ #
# def recorder(self, num, command, *args):
# if command == "status":
# return self.recorderstatus(num)
# if command == "start":
# return self.recorderstart(num)
# if command == "stop":
# return self.recorderstop(num)
# return "LiquidSoapPlayerClient does not understand mixer." + command + str(args)
# ------------------------------------------------------------------------------------------ #
# def recorderstatus(self, num):
# """
# get status of a recorder
# :return:
# """
# self.command("recorder_" + str(num), "status")
# return self.message
# # ------------------------------------------------------------------------------------------ #
# def recorderstart(self, num):
# """
# get status of a recorder
# :return:
# """
# self.command("recorder_" + str(num), "start")
# return self.message
# # ------------------------------------------------------------------------------------------ #
# def recorderstop(self, num):
# """
# get status of a recorder
# :return:
# """
# self.command("recorder_" + str(num), "stop")
# return self.message
# ------------------------------------------------------------------------------------------ #
# def skip(self, namespace="playlist", pos=""):
# """
......
......@@ -154,4 +154,91 @@ def currecording()
else
""
end
end
\ No newline at end of file
end
### LIBRARY ###
########################
# record to filesystem #
########################
# shows current file and how many bytes were written so far
def currecording(recfile)
if recfile != "" then
bytes_written = list.hd(default="", get_process_lines("echo $(($(stat -c%s "^recfile^")))"))
"#{recfile}, #{bytes_written}B"
else
""
end
end
def start_recorder(folder, duration, encoding, bitrate, channels, filenamepattern, is_recording, stream, recorder_number) =
source = ref stream
stereo = (int_of_string(channels) >= 2)
# define on_start, on_close (good case) and on_stop (error case)
recfile = ref ''
def on_start()
is_recording := true
recfile := list.hd(default="", get_process_lines("date +#{filenamepattern}"))
end
def on_close(filename)
is_recording := false
recfile := list.hd(default="", get_process_lines("date +#{filenamepattern}"))
end
def on_stop()
is_recording := false
end
# register server function
server.register(namespace="recorder_"^recorder_number, description="Show current file.", usage="curfile", "curfile", fun (s) -> currecording(!recfile) )
# dumbass liquidsoap cannot handle one output definition for mono and stereo
output_filesystem_mono = output.file(id="recorder_"^recorder_number, perm = 0o664, on_start=on_start, on_close=on_close, on_stop=on_stop, reopen_when={ int_of_float(gettimeofday()/60.) mod duration == 0 })
output_filesystem_stereo = output.file(id="recorder_"^recorder_number, perm = 0o664, on_start=on_start, on_close=on_close, on_stop=on_stop, reopen_when={ int_of_float(gettimeofday()/60.) mod duration == 0 })
# %ifencoder %aac
# if encoding == "aac" then
# log("ENABLING aac recorder to filesystem")
# %include "outgoing_recordings/aac.liq"
# end
# %endif
# %ifencoder %flac
if encoding == "flac" then
log("ENABLING flac recorder to filesystem")
%include "outgoing_recordings/flac.liq"
end
# %endif
# %ifencoder %mp3
if encoding == "mp3" then
log("ENABLING mp3 recorder to filesystem")
%include "outgoing_recordings/mp3.liq"
end
# %endif
# %ifencoder %vorbis
if encoding == "ogg" then
log("ENABLING ogg recorder to filesystem")
%include "outgoing_recordings/ogg.liq"
end
# %endif
# %ifencoder %opus
if encoding == "opus" then
log("ENABLING opus recorder to filesystem")
%include "outgoing_recordings/opus.liq"
end
# %endif
# %ifencoder %wav
if encoding == "wav" then
log("ENABLING wav recorder to filesystem")
%include "outgoing_recordings/wav.liq"
end
# %endif
end
......@@ -129,9 +129,6 @@ output_source = fallback_three
# create soundcard output
%include "out_soundcard.liq"
# recording output
%include "out_filesystem.liq"
# stream output
%include "out_stream.liq"
......
......@@ -159,85 +159,3 @@ def get_output(source, device, name) =
output.dummy(id=name^"_DUMMY", blank())
end
end
########################
# record to filesystem #
########################
# shows current file and how many bytes were written so far
def currecording(recfile)
if recfile != "" then
bytes_written = list.hd(default="", get_process_lines("echo $(($(stat -c%s "^recfile^")))"))
"#{recfile}, #{bytes_written}B"
else
""
end
end
def start_recorder(folder, duration, encoding, bitrate, channels, filenamepattern, is_recording, stream, recorder_number) =
source = ref stream
stereo = (int_of_string(channels) >= 2)
# define on_start, on_close (good case) and on_stop (error case)
recfile = ref ''
def on_start()
is_recording := true
recfile := list.hd(default="", get_process_lines("date +#{filenamepattern}"))
end
def on_close(filename)
is_recording := false
recfile := list.hd(default="", get_process_lines("date +#{filenamepattern}"))
end
def on_stop()
is_recording := false
end
# register server function
server.register(namespace="recorder_"^recorder_number, description="Show current file.", usage="curfile", "curfile", fun (s) -> currecording(!recfile) )
# dumbass liquidsoap cannot handle one output definition for mono and stereo
output_filesystem_mono = output.file(id="recorder_"^recorder_number, perm = 0o664, on_start=on_start, on_close=on_close, on_stop=on_stop, reopen_when={ int_of_float(gettimeofday()/60.) mod duration == 0 })
output_filesystem_stereo = output.file(id="recorder_"^recorder_number, perm = 0o664, on_start=on_start, on_close=on_close, on_stop=on_stop, reopen_when={ int_of_float(gettimeofday()/60.) mod duration == 0 })
# %ifencoder %aac
# if encoding == "aac" then
# log("ENABLING aac recorder to filesystem")
# %include "outgoing_recordings/aac.liq"
# end
# %endif
# %ifencoder %flac
if encoding == "flac" then
log("ENABLING flac recorder to filesystem")
%include "outgoing_recordings/flac.liq"
end
# %endif
# %ifencoder %mp3
if encoding == "mp3" then
log("ENABLING mp3 recorder to filesystem")
%include "outgoing_recordings/mp3.liq"
end
# %endif
# %ifencoder %vorbis
if encoding == "ogg" then
log("ENABLING ogg recorder to filesystem")
%include "outgoing_recordings/ogg.liq"
end
# %endif
# %ifencoder %opus
if encoding == "opus" then
log("ENABLING opus recorder to filesystem")
%include "outgoing_recordings/opus.liq"
end
# %endif
# %ifencoder %wav
if encoding == "wav" then
log("ENABLING wav recorder to filesystem")
%include "outgoing_recordings/wav.liq"
end
# %endif
end
......@@ -151,13 +151,6 @@ server.register(namespace = "auraengine",
ret = ret^'"stream_3": {"enabled": #{s3_enable}, "connected": #{!s3_connected}},'
ret = ret^'"stream_4": {"enabled": #{s4_enable}, "connected": #{!s4_connected}}'
ret = ret^'},'
ret = ret^'"recorder": {'
ret = ret^'"recorder_0": {"enabled": #{r0_enable}, "recording": #{!r0_is_recording}},'
ret = ret^'"recorder_1": {"enabled": #{r1_enable}, "recording": #{!r1_is_recording}},'
ret = ret^'"recorder_2": {"enabled": #{r2_enable}, "recording": #{!r2_is_recording}},'
ret = ret^'"recorder_3": {"enabled": #{r3_enable}, "recording": #{!r3_is_recording}},'
ret = ret^'"recorder_4": {"enabled": #{r4_enable}, "recording": #{!r4_is_recording}}'
ret = ret^'},'
ret = ret^'"linein": {'
ret = ret^'"linein_0": {"enabled": #{a0_in != ""}},'
ret = ret^'"linein_1": {"enabled": #{a1_in != ""}},'
......@@ -176,9 +169,7 @@ server.register(namespace = "auraengine",
ret
# outgoing streams enabled?
#ret = "stream_0_enabled:#{!s0_enable}, stream_1_enabled:#{!s1_enable}, stream_2_enabled:#{!s2_enable}, stream_3_enabled:#{!s3_enable}, stream_4_enabled:#{!s4_enable}, "
# outgoing recorder enabled
#ret = ret^"recorder_0_enabled:#{r0_enable}, recorder_1_enabled:#{r1_enable}, recorder_2_enabled:#{r2_enable}, recorder_3_enabled:#{r3_enable}, recorder_4_enabled:#{r4_enable}, "
#ret = "stream_0_enabled:#{!s0_enable}, stream_1_enabled:#{!s1_enable}, stream_2_enabled:#{!s2_enable}, stream_3_enabled:#{!s3_enable}, stream_4_enabled:#{!s4_enable}, "
#ret = ret^"linein_0_enabled:#{a0_in != ''}, linein_1_enabled:#{a1_in != ''}, linein_2_enabled:#{a2_in != ''}, linein_3_enabled:#{a3_in != ''}, linein_4_enabled:#{a4_in != ''}, "
#ret = ret^"lineout_0_enabled:#{a0_out != ''}, lineout_1_enabled:#{a1_out != ''}, lineout_2_enabled:#{a2_out != ''}, lineout_3_enabled:#{a3_out != ''}, lineout_4_enabled:#{a4_out != ''}, "
#ret = ret^"fallback_max_blank:#{fallback_max_blank}, fallback_min_noise:#{fallback_min_noise}, fallback_threshold:#{fallback_threshold}"
......
......@@ -79,13 +79,6 @@ fallback_threshold = float_of_string(list.assoc(default="", "fallback_threshold"
fade_in_time = list.assoc(default="", "fade_in_time", ini) #int_of_string(list.assoc(default="", "fade_in_time", ini))
fade_out_time = list.assoc(default="", "fade_out_time", ini) #int_of_string(list.assoc(default="", "fade_out_time", ini))
# RECORDER SETTINGS
#rec_0_filetype = list.assoc(default="", "rec_0_filetype", ini)
#rec_1_filetype = list.assoc(default="", "rec_1_filetype", ini)
#rec_2_filetype = list.assoc(default="", "rec_2_filetype", ini)
#rec_3_filetype = list.assoc(default="", "rec_3_filetype", ini)
#rec_4_filetype = list.assoc(default="", "rec_4_filetype", ini)
# ALSA / pulse settings
soundsystem = list.assoc(default="", "soundsystem", ini)
use_alsa = soundsystem == "alsa"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment