-
I'm trying to achieve smooth transitions (crossfades) between sources in a fallback setup, specifically between a live DJ stream (input.harbor) and an automated playlist. My goal is to have the playlist fade out smoothly when the DJ connects, and the DJ's audio fade in, and vice versa when the DJ disconnects. Currently, transitions are abrupt, and my attempts to use custom transitions have either resulted in harsh audio artifacts. Here's the relevant part of my main.liq script, which works perfectly except for the lack of smooth transitions: `# Settings Environment Variablespassword_dj=environment.get("PASSWORD_DJ") Convert string to integerport_live_int=int_of_string(port_live) Define the original playlist source and apply nrjoriginal_playlist_source=playlist("~/music/playlist.pls") Apply crossfades to the playlistoriginal_playlist = crossfade(fade_out=3.0, fade_in=3.0, original_playlist) Security fallbacksecurity_source=single("~/music_security/security.mp3") Support for live streamslive=input.harbor( Fallback for live and music playlistsradio=fallback(track_sensitive=false, [live, inv1, inv2, inv3, playlist_securitized]) Stream it out MP3output.icecast( I tried adding custom transitions to the fallback based on the Liquidsoap book (Transitions between different sources), like this: `# Transition for the live source (live, inv1, inv2, inv3) Transition for the playlistdef to_playlist(previous, next) radio=fallback( However, this resulted in a "harsh noise" during transitions and occasional client disconnections. Could someone help me craft a reliable solution for smooth transitions between these sources? Ideally, I'd like a 1-2 second crossfade when switching between live (or inv1, inv2, inv3) and playlist_securitized, without artifacts or service interruptions. Any advice on avoiding conflicts with the existing crossfade on the playlist would be appreciated. Versions: Thanks in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
Bumping this thread to check if there are any updates or solutions available now. |
Beta Was this translation helpful? Give feedback.
-
Hi @gAlleb, Thank you so much for taking the time to help and for sharing your solution for AzuraCast! I really appreciate your effort. However, I don’t have much experience programming Liquidsoap scripts, so adapting this solution to my specific setup feels quite challenging for me. I’ll wait for other users who might be able to help adapt it to my case. I really miss seeing @toots and @vitoyucepi in this thread—they’ve been so helpful in the past. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
I don’t mean to be a bother again, and in fact, this will be my last message here unless someone responds to me first. However, I’m quite surprised that no one from the team has at least shared their perspective on this issue. I completely understand that my timeline might not align with others’, and that help here is given as much as possible since this is a collaborative and free platform where no one is obligated to assist. But I’d really appreciate at least knowing whether what I need is currently possible or not. Back in 2023, I faced the same situation months went by, I eventually stopped pushing for a solution, and I ended up abandoning my radio project until now, when I’m back with the same concerns as before. I’ve listened to other colleagues’ radio stations where this feature works perfectly, but I can’t ask them for advice because they use contracted streaming services, meaning they don’t handle the programming themselves. I also provided details in a related bug report (#4179), but so far, those haven’t been addressed either. Thank you to anyone who takes the time to read this! |
Beta Was this translation helpful? Give feedback.
-
Hi @Stefan, Thank you so much for your reply and for the solution you shared earlier—I really appreciate the time and effort you put into helping me. I’m sorry if my previous message came across as dismissive; that wasn’t my intention at all. I truly value your suggestion, but I felt a bit overwhelmed trying to adapt it to my setup since I’m not very experienced with AzuraCast and Liquidsoap configurations. I realize now that I should have tried it first and provided more feedback. I’d love to give your solution a try, but I could use some guidance on how to start. My setup doesn’t use AzuraCast directly—it’s a custom Icecast2 server with Liquidsoap for streaming, and I’m worried about breaking something if I don’t adapt it correctly. Could you please help me understand how I can test your solution safely in my environment? For example, should I set up a staging server first, or are there specific parts of your code I should adjust for a non-AzuraCast setup? Thank you again for your patience and support—I’m really grateful for your expertise and willing to put in the effort to make this work with your guidance. Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hi GaLLeb, Thank you so much for taking the time to help me and for sharing such detailed solutions! I really appreciate your effort and the example code you provided. I tested the script as suggested, and while it ran smoothly with no errors, I didn’t notice a significant difference in my setup compared to my original configuration. I’ve decided to stick with my current setup for now, as it’s working reliably for me. Your input has been incredibly valuable, and I’ll definitely keep your suggestions in mind for future adjustments. Best regards, |
Beta Was this translation helpful? Give feedback.
In older versions of LS, the "live" source could be before the crossfade, so it could be crossfaded as well. In theory, this would also allow "clean skips", i.e. no artifacts after live ends, because the skip could happen while we still have separate (unmixed) tracks.
Now (in recent versions of LS) the only way to use live without experiencing buffering problems is to move "live" fallback after the crossfade. That, in turn, now brings no crossfades. All you can do is tell LS to skip the non-live source and fade it out after live source is connected. When live source is disconnected - start new track. That's how it is and there is no magic trick to it.
Full examaple code, just change where…