Skip to content

No pre-queue when reading for the next audio from an external script #2016

Answered by ArvyRogerio
ArvyRogerio asked this question in Q&A
Discussion options

You must be logged in to vote

After some hours reading and testing, a found a way to achieve the same functioning.

Here is (I'm not sure if the code is well optimized, any tips appreciated).

musics = request.dynamic.list(prefetch=0,fun()->[])

radio = musics
radio = cue_cut(radio)
radio = crossfade(fade_in=0.,fade_out=0.,radio)
radio = mksafe(radio)
radio = fallback(track_sensitive=false,[radio])

def analis() =
  rest=source.remaining(radio)
  if rest!=infinity and rest<10. and list.length(musics.queue())==0 then
     nov=process.read("/bin/php /root/generator.php")
     ignore(musics.add(request.create(nov)))
  end
  3.
end

thread.run.recurrent(delay=0.,analis)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ArvyRogerio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant