-
I want to record from input.harbor but cannot manage how can I define source before Version: liquidsoap_2.0.4-ubuntu-focal-3_amd64.deb Code example djBlank = blank(id="dj")
dj = ref((djBlank:source))
def onConnect
output.file(%mp3, "archive/%Y-%m-%d/%H-%M-%S.mp3", mksafe(!dj), reopen_when={0m})
null()
end
dj := input.harbor(buffer=12., debug=true, on_connect=onConnect, password="hackme", port=8005, "dj") This code throws error: rolla-liquidsoap | At /home/liquidsoap/config/input/dj-input.liq, line 9, char 54-63:
rolla-liquidsoap | dj := input.harbor(buffer=12., debug=true, on_connect=onConnect, password="hackme", port=8005, "dj")
rolla-liquidsoap |
rolla-liquidsoap | Error 5: this value has type
rolla-liquidsoap | _? (inferred at /home/liquidsoap/config/input/dj-input.liq, line 6, char 4-10)
rolla-liquidsoap | but it should be a subtype of the type of the value at /usr/share/liquidsoap/2.0.4/libs/telnet.liq, line 101, char 26-47
rolla-liquidsoap | (_) -> _
rolla-liquidsoap exited with code 1 |
Beta Was this translation helpful? Give feedback.
Answered by
toots
Jun 7, 2022
Replies: 2 comments 3 replies
-
Okay I figured out myself, that the problem was with ref declaration and that I must add one argument headers to the onConnect function dj = ref(blank())
def record()
output.file(%mp3(samplerate=44100, bitrate=320), "content/archive/%Y-%m-%d/%H-%M-%S.mp3", mksafe(!dj), reopen_when={0m})
{}
end
def startRecord()
thread.run((fun() -> begin record() end))
end
def onConnect(headers)
startRecord()
{}
end
dj := input.harbor(on_connect=onConnect, password="hackme", port=8005, "dj") |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hmm. If this works this is cool but I'm curious why you need to change the source? |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
rrolla
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hmm. If this works this is cool but I'm curious why you need to change the source?