Ah yes, it makes sense but is different from what I'm trying to do. I
have an input stream or playlist that is (effectively) always
available. That gets output out to a different icecast2 server.
Ideally I'd like to temporarily stop the input stream or playlist and
switch to something generated (maybe using the noise() or say()
function) whenever the number of listeners connected to my icecast2
server drops to 0. No sense in wasting bandwidth by staying connected
to an input.http() stream, or in thrashing a disk playing a local
file, when there isn't actually anyone listening to it.
Newer versions of icecast2 provide some nice status data in json
format. My current thought is to use something like
of_json(http.get("http://127.0.0.1:8000/status-json.xsl")), parse out
the "listeners":1, field, then make a decision in liquidsoap based on
the value of that field. Of course I've oversimplified the
of_json(http.get()) use, it doesn't exactly work like that ...
http.get returns headers and such besides the json data, so that
result would need to be filtered a bit before being sent to of_json().
I haven't quite wrapped my head around parsing the result from the
http.get() yet, but it'll come.
On Fri, May 29, 2015 at 2:50 PM, Sarah k Alawami <[email protected]> wrote:
> Yeah. I modified the code in the cook book, section on harbor mount, to suit
> my needs. So for me I have it branching in to 3, one day 4, streams when I go
> live, then fall back to my playlist which is on a constant loop. That
> playlist also branches out to the 3 streams.
>
> I hope that makes sence.
>> On May 29, 2015, at 11:42 AM, Detrick Merz <[email protected]> wrote:
>>
>> If I understand right, your example will default to playing the live
>> stream, but fallback to the playlist if the live stream stops coming
>> in. Does that seem right?
>>
>> tnx de detrick
>>
>> On Tue, May 26, 2015 at 6:29 PM, Sarah k Alawami <[email protected]> wrote:
>>> Ok, what I did was set up a harbor stream. here's my code with passwords
>>> changed of corse.
>>>
>>> pasted.co/d63e0c67.
>>>
>>> On May 26, 2015, at 3:22 PM, Detrick Merz <[email protected]> wrote:
>>>
>>> In my case, I have a liquidsoap+icecast2 server. Liquidsoap presently
>>> uses an Internet stream as an input, and outputs to icecast. Nodes
>>> within my house connect to my local icecast server. When no nodes are
>>> connected it seems like it would be polite to also have Liquidsoap
>>> stop using the Internet stream as an input (since no humans are
>>> actually listening to the stream).
>>>
>>> My thought would be something like switching to noise() or say(), or
>>> something else that doesn't access the disk repeatedly, whenever the
>>> number of listeners drops to 0. When at least one listener is
>>> connected, switch back to re-streaming the Internet stream.
>>>
>>> On Tue, May 26, 2015 at 6:00 PM, Sarah k Alawami <[email protected]> wrote:
>>>
>>> do you mean switch to an automation stream? or what. Can you maybe give us
>>> an example of what you want to do? Iv'e never heard of this but that does
>>> not mean it's not out there.
>>>
>>> Take care.
>>>
>>> On May 26, 2015, at 2:06 PM, Detrick Merz <[email protected]> wrote:
>>>
>>> Before I go trying to reinvent the wheel, does anyone have a code
>>> snippet that will default to noise() or something when the number of
>>> active listeners drops to 0? It seems like the json status that newer
>>> versions of icecast2 have should make this possible if I'm thinking
>>> about it right.
>>>
>>> Thanks,
>>>
>>> -detrick
>>>
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> Savonet-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> Savonet-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> Savonet-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Savonet-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Savonet-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
------------------------------------------------------------------------------
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users