Hello, Thanks for the tip about source.on_end. I've been reading the documentation a lot over the last few days and still missed that.
I'm trying to just use that function to skip the currently playing track when it triggers, but I can't seem to get the syntax down. Would you mind having a look? audio = playlist(prefix="annotate:liq_cue_in=\"120.\":",prefetch=4,loop=true,mode="randomize", "/home/liquidsoap/Audio") audio = cue_cut(cue_in_metadata="liq_cue_in", audio) audio = source.on_end(id="audio",delay=120.,source.skip(audio)) I realize that if this were to work, it may not cut at exactly two minutes, but it should be close enough, and would save me having to store the duration of all of my audio in order to query it for each track. On Sun, Jul 24, 2022, at 12:06, Romain Beauxis wrote: > Hmm sorry I'm re-reading it now and, yeah, `cue_cut` takes cueing > points from the beginning of the file. There is an operator called > `source.on_end` that works from the end of the track. > > Track durations have historically been unreliable. This is mostly > because liquidsoap is a streaming engie so, for instance, if we are > streaming live audio from a DJ, there's no easy way to know the track > duration. In the past, we also worried about CPU usage required to > compute track length but that was a long time ago before ffmpeg could > do that for us transparently for most formats :-) > > What we recommend, however, is to pre-process all your tracks before > sending them to liquidsoap, adding/computing duration and cue in/out > points. This makes your system more robust anyways. > > Romain > > Le dim. 24 juil. 2022 à 11:01, Romain Beauxis > <romain.beau...@gmail.com> a écrit : >> Hi! >> >> `cue_cut` should also be able to cut the last 2 minute of each file. >> >> Le mar. 19 juil. 2022 à 08:29, Pedro Manuel <icq8...@fastmail.com> a écrit : >>> Hello, I was wondering if I could get some assistance. >>> >>> I have a very basic stream, wherein I am reading a playlist and sending the >>> audio out. My goal is to trim two minutes from the beginning and the end of >>> each track. >>> >>> I've got the beginning trim covered by using cue_cut, but I haven't been >>> able to think of a way to trim from the end, since there doesn't appear to >>> be a way to retrieve the total duration of a file. >>> >>> I was wondering if any of you may have an idea about how this could be >>> accomplished. >>> >>> >>> Thanks >>> >>> >>> _______________________________________________ >>> Savonet-users mailing list >>> Savonet-users@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/savonet-users > > _______________________________________________ > Savonet-users mailing list > Savonet-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/savonet-users _______________________________________________ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users