Romain,

Well to put it simple enough...

You gave us a way to feed tracks into liquidsoap dynamically. Liquidsoap is 
doubling up on the request.create as its next song (instantly when it loads the 
song). First, can you explain to me how I'm supposed to comfortably feed songs 
to liquidsoap when its playing each one two times? Is there a way to pass a 
Playlist... or perhaps 2 songs at once, so that gives me till the current song 
ends to get new returned when request.create calls on the script.

Basically:

Request.create receives the MP3.

Liquidsoap says, ok I'll load this, and Oh since I see this is the main 
fallback for receiving music, I'll go ahead and load it again! Now I have two 
of the same track ready to play (...)..

I just need to know how to tell Liquidsoap what to load. I don't know SH 
programming, I'm actually a pure PHP programmer. But it's a real mystery here 
what your software wants to receive, and how it should be received. It's been a 
guessing game.

Once I can dynamically talk to liquidsoap using the request.create (without 
every request being a duplicate, and without liquidsoap needing a new fallback 
to facilitate it during this dynamic method), I'll add a fallback playlist 
later. Right now I'm focusing on how to have full control over liquidsoap using 
request.dynamic, so I can begin writing a scheduler in PHP.


Here's the script so far:


#set("init.daemon", true)
set("log.file.path", "nfm.log")

set("server.telnet",true)



def request () =
  request.create(audio=true, 
list.hd(get_process_lines("/home/nocturnal/track.sh")))
end


def fade(jingles,s)
  fade_in = 12.
  fade_out = 10.
  start_next = 3.
  def fader(from,to)
    from = fade.out(duration=fade_out,from)
    to = fade.in(duration=fade_in,to)
    add(normalize=false,
        [ to,
          sequence([ jingles, fallback([]) ]),
          from ])
  end
  cross(duration=start_next,fader,s)
end

live = input.http(id="live", buffer=10., 
                  autostart=false, "http://localhost:8000/live";)
live = insert_metadata(id="livemeta",clear_metadata(live))
live = strip_blank(length=10.,live)


# Transitions & Jingle

        jingle =  normalize( single 
("/home/nocturnal/tunes/JINGLE/NFM-Jingle-20090904.mp3") )

# Fallbacks

        radio = fallback(track_sensitive = false, [request.dynamic(request), 
blank()])

# Add Jingle

        radio = fade(jingle,radio)


# Outputs

        output.icecast.vorbis (
          *****,
          radio)







-----Original Message-----
From: Romain Beauxis [mailto:[email protected]] 
Sent: Wednesday, September 09, 2009 9:13 PM
To: Nathan Huebner
Cc: [email protected]
Subject: Re: [Savonet] #303: Large tracks take long to load

Le mercredi 9 septembre 2009 20:54:06, vous avez écrit :
> The latest problem is that LiquidSoap automatically loads up the same file
>  when I do dynamic requests.
> 
> So In order for 1 song to play, and then the next correct song, liquidsoap
>  will play each one 2 times.
> 
> I tried echoing back 2 lines, but liquidsoap doesn’t error, it just...
>  doesn’t do anything...
> 
> Track.sh:  (try # 1 success, infinitely repeats the track)
> 
> echo "/home/nocturnal/tunes/_TODAY/13.today.mp3"
> 
> Track.sh   (Doesn't error or anything, just doesn't stream -- mainly
>  because I don’t have a fallback, because I don't want one (at least until
>  I get everything running through this dynamic request system))
> 
> echo "/home/nocturnal/tunes/_TODAY/13.today.mp3"
> echo "/home/nocturnal/tunes/_TODAY/14.today.mp3"

Heh.. The problem, I guess is that you have never written a script so far, have 
you ? :-)

The problem that you will run into now is that you need to consider all that 
you want 
for your system. By that I mean write down exactly the specifications that you 
want 
for the songs to be played.

Then, you will need to implement them, which means choose a language and write 
a 
program that finds the correct song according to the specifications.

However, this should not be too difficult. I could try to help. Could you 
please try to 
write what exactly you want to do for selecting a new song. Try to answer as 
simply 
as possible to the question:
  "Hey, I am liquidsoap. I need to queue a new song, which file should I add ?"
:-)

Le mercredi 9 septembre 2009 20:57:15, vous avez écrit :
> Here's what our playlist metadata did...
> 
> 
> #playlist = rewrite_metadata(
> #                           [("artist",("[Nocturnal.FM Main]
>  "^"$(artist)")), #                            ("title",("$(title) "^"[The
>  best trance & progressive] "^"$(album)  ")),
>  #                             ("album","")],playlist)
> 
> 
> Basically, 
> 
> [Nocturnal.FM] Romain Beauxis - Liquidsoap Trance (Original Mix) [The best
>  trance & progressive] $(album)
> 
> The same way we had our playlist setup... I'm sorry I don't know how to do
>  any of this stuff :(

Well, you can do exactly the same !
In the code you show, playlist is a variable, so it could be named anything 
else. 
For instance:

s = request.dynamic(...)

s = rewrite_metadata(
                           [("artist",("[Nocturnal.FM Main] "^" $(artist)")),   
                   
                            ("title",("$(title) "^" [The best trance & 
progressive] "^" $(album) ")),
                            ("album","")], s)

Here I have replace "playlist" by "s", but you could also use any variable name 
that you like..


Romain


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to