Thanks very much for the help! Yes, calm gentle and patient is good. I was just a bit frustrated yesterday, Apologies if my posts seemed harsh.
So... source = append(merge=true, source, fun(m) -> blank(duration=0.1)) Does work for me, though the result is only 30ms of blank, not 100. (the flush issue again?) I'm not sure what the "fun(m) ->" part means or does, but hey, if it works, that's fine with me, I'm a pragmatist. So in trying to account for padding at start and lost data at the end of mp3 files I have something like this: source = once(single(argv(1))) source = append(merge=true, source, fun(m) -> blank(duration=0.1)) source = eat_blank(at_beginning=true,max_blank=0.05,source) output.file(%mp3.cbr(bitrate=320,internal_quality=1,id3v2=true), argv(2), fallible=true, on_stop=shutdown, source) But I still get double the padding at the start, and the addition at the end is only 30ms, which is then eaten by eat_blank (when I told it not to), and the original source mp3 data is still truncated before the blank is added. So, getting closer, but still not there. I guess my next step is to collect all the various bits and pieces of the liquidsoap source from github and attempt to build it myself and test variations of your proposed patch to see what I get. Apr 29, 2013 03:42:45 AM, [email protected] wrote: >Hi, >The append function has this type, if we forget about optional parameters: >append( source('a), (([(string*string)])->source('a)) )->source('a) >This means that it is a function which takes as arguments :- a source (to >which we want to append a track to every track) - a function which takes as argument the metadata of the current track and returns the track to append (this design was chosen so that the appended track can depend on the current track)and returns a source. >So, it could be used with something like >s = append(s, fun(m) -> blank(duration=0.1)) >The function "fun(m) -> blank(duration=0.1)" simply does not uses its argument >m which contains the metadata of the current track, since we don't need it >here. >Some concepts behind Liquidsoap can be difficult to grasp at first, this is >normal and we are here to help. But generally they have been introduced for a >good reason (in this case, we want to be able to generate the added track >differently for each track), so please keep calm, gentle and patient here, and >usually the issue will be solved quite quickly. >++ >Sam. > >On Mon, Apr 29, 2013 at 1:59 AM, [email protected] [email protected]> wrote: > >In an effort to work around the data lost at > the end of a file encoded to mp3 (Lame) > I am trying to append a blank to the end > of my source and have it cut off instead > of actual sound information, but I cannot > make heads or tails of the append function > in the documentation: > > append(?id:string,?insert_missing:bool,?merge:bool,source('a), > (([(string*string)])->source('a)))->source('a) > > What would an actual call to this function > look like? I can only find one example of its > use (in utils.liq) but I find it equally baffling: > fun (s,~pattern=p) -> > append(s,fun (m) -> request.queue(queue=[request.create(pattern % m)], > interactive=false)) > > Let's say I have a source: > source = once(single(argv(1))) > > and I want to append 100ms of blank data to it..: > once(blank(duration=0.1)) > > What would the append call look like? Is it some kind of queer oCaml thing? > > append(merge=true, once(blank(duration=0.1)), source) > does not work... > > source -> append(merge=true, once(blank(duration=0.1)) -> source) > does not work... > > I have no idea what the documentation is trying to say. It just makes no sense. > > I just wan't to append/merge a bit of blank data to the end of my source. > Does anybody know how to do that? > Or does anyone understand the syntax of append? > > ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr _______________________________________________ Savonet-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/savonet-users
