Le Thursday 26 June 2008 15:46:55 Titouan Mesot, vous avez écrit :
> Hello,

        Hi !

> I'm trying to use Liquidsoap as link between asterisk, mpd and icecast2.
>
> But I don't understand realy how it works for in/output ...
>
> It's install on a dedicated server, so I don't have any sound card ...
>
> Here my test script :
>
> #!/usr/bin/liquidsoap
> # Log dir
> set("log.file.path","/home/radio/log/liquidsoad-test1.log")
>
> # Lecture flux 1
> in = input.http("localhost:8000/alternradio.ogg")

you should use "http://localhost:8000/alternradio.ogg"; here..

>
> # Stream it out
> output.icecast.vorbis(host = "localhost", port = 8000, password =
> "Mypass", mount = "liquidsoap.ogg, in")
>
>
> And it didn't work ..
>
> ks353469:/home/radio/script# liquidsoap test1.liq
> No output defined, nothing to do.
> ks353469:/home/radio/script#
>
> I don't understand why it didn't work, I have an output ... ?

Hummm... :-)

Typo ? ;-)

> # Stream it out
> output.icecast.vorbis(host = "localhost", port = 8000, password =
> "Mypass", mount = "liquidsoap.ogg", in)

Get the difference ? :-)


Just a side note now that you're at this point let's take some time to explain 
another important notion for functional languages. You might already know it, 
but perhaps not every user...

As for most functional language, variables in liquidsoap can also be partially 
applied functions.

For instance, a function like:
def f(a,b) = 
  a ^ " " ^ b 
end
is an object f of type  (string,string) -> string

Then f("input1") is an object of type (string) -> string, and 
f("input1","input2") is an object of type string, since the function is fully 
applied now.

In your script, you have:
16:34 [EMAIL PROTECTED] ~/sources/svn/savonet/trunk/liquidsoap/src% liquidsoap 
-h 
output.icecast.vorbis
*** One entry in scripting values:
Output the source stream as an Ogg Vorbis stream to an Icecast-compatible 
server in Variable BitRate mode.
Category: Source / Output
Type: 
(?id:string, ?samplerate:int, ?stereo:bool, ?start:bool, ?restart:bool, 
?restart_delay:int, 
?host:string, ?port:int, ?user:string, ?password:string, ?genre:string, 
?url:string, 
?description:string, ?public:bool, ?multicast_ip:string, ?sync:bool, 
?dumpfile:string, 
?mount:string, ?name:string, source, ?quality:float)->source

The ?id:string means it is a labeled optional parameter.

As you can see, there are a lot of parameters, but the only mandatory one 
is "source", which was missing in the script above.

So, what you wrote:
> output.icecast.vorbis(host = "localhost", port = 8000, password =
> "Mypass", mount = "liquidsoap.ogg, in")

Is not an applied function, hence has type:
(?id:string, ?samplerate:int, ?stereo:bool, ?start:bool, ?restart:bool, 
?restart_delay:int, ?user:string, ?genre:string, ?url:string, 
?description:string, ?public:bool, ?multicast_ip:string, ?sync:bool, 
?dumpfile:string, ?name:string, source, ?quality:float)->source

(host, port, password and mount are removed..)

But, as soon as you apply it with a source, liq knows that the function can be 
fully applied, and you get an object of type "source", which is an output, so 
it can start streaming !


Romain

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to