Le 14/06/2011 20:40, Romain Beauxis a écrit :
> Hi Martin!
>
> 2011/6/14 Martin Hamant<[email protected]>:
>> I am using a partial application with robinet to create the output from
>> parameters that are passed dynamically.
>>
>> I have to find a way to pass the format (the codec) with which the
>> playlist is going to be created.
>>
>> out = output.shoutcast(
>> fallible=true,
>> start=false
>> )
>> (...)
>> variables retrieval (stream_paramx; etc)
>> (...)
>>
>> # The following returns an error, the purpose is to explain what I need
>> # The output
>> output = out(%"#{stream_format}", id="#{stream_id}",
>> host="#{stream_host}", port=int_of_string("#{stream_port}"),
>> password="#{stream_password}", genre="#{stream_genre}",
>> url="#{stream_url}", name="#{stream_description}", s)
>>
>> I have read http://savonet.sourceforge.net/doc-svn/encoding_formats.html
>> but it doesn't really helped me to know if it was possible.
> This is indeed a tricky case.
>
> We use format values to find out the content type of the streams
> (audio/video tracks, mono/stereo etc..). Thus, for some technical
> reasons, format values cannot use variables.
>
> What you should do is the following:
> # Grab format
> format =
> if stream_format == "mp3" then
> %mp3
> elsif stream_format == "vorbis" then
> %vorbis
> (...)
> end
>
> This may get a little bit more tricky if you want to also have
> mono/stereo formats. Let us know if you reach that point so we can
> help you with it too ;)
>
> Romain
Hi Romain, David and the list !
by
if stream_format == "mp3" then
%mp3
(...)
end
Do you mean:
if stream_format == "mp3" then
output = out(%mp3, bla, bla, blu, s)
(...)
end
The cool thing would be able to do partial app like
if stream_format == "mp3" then
output = out(%mp3,s)
...
end
output=out(bla, bla, blu, s)
(...)
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users