From: Romain B. <rom...@gm...> - 2024-03-25 03:39:42
|
Hi Franz, The github discussions and/or discord are a better place us these days! Le sam. 23 mars 2024 à 10:22, franz--- via Savonet-users < sav...@li...> a écrit : > Hello everyone, > > i want to have a solution to detect a 2 second 18Hz Signal in a livestream > to play out a Jingle over the input signal. > I tried since das to get a solution. Someone told me that it is possible > with liquidsoap. > This is my current siple code (just for testing): > > #!/usr/bin/liquidsoap > > set("log.file.path", "/var/log/liquidsoap/radio.log") > playlist = playlist("/media/USB/Musik/") > jingle1= single("/media/USB/Musik/jingle.mp3") > > url = "https://stream.antenne.de/antenne/stream/mp3" > interlude = mksafe(input.http(url)) > security = single("/media/USB/Musik/emergency.mp3") > radio = playlist > > radio = fallback(track_sensitive = false, [radio, security]) > > radio = fallback(track_sensitive=false, [blank.strip(max_blank=1., radio), > interlude]) > > output.icecast(%mp3(bitrate=256,id3v2=true,samplerate=48000), > host = "XXXXX", port = 8000, > password = "XXXX", mount = "radio", > radio) > > > The current url is just for testing the fallback to an other stream if > something went wrong. > How is it possible to detect the 18Hz and play the jingle1.mp if a two > second long 18Hz signal is detected (For safety it will be 180degree phase > shifted between the Channels). If that would be possible, i would like to > have more frequecies ( maybe 20Hz and 22Hz) for jingle2 and jingle3. Is > there anybode who can help me? > I'm not quite sure that we have anything for this yet. We have `sine.detect` operator that I am not very familiar with -- it was developed as part of the DTMF generation/detection work. You might want to start with it. If not, it shouldn't be too hard to implement your own operator if you are already familiar with the kind of signal processing required for it. Once you have a working detection operator, triggering the jingle and etc should indeed be pretty straight forward. -- Romain |