Hi Bill,
I played a bit with liquidsoap. Prepend is even more tricky to use
than I remembered. In the end the only stable solution I have starts
the intro jingle by a synthesized sound, to wait for files to be
ready. I did not find a way to force a dynamically created file source
to be immediately ready.
# pushing "shows" using telnet
show = request.queue(id="rec")
def intro(metadata)
x = (if metadata["tag"] == "" then "a" else "b" end)
l = [ "/tmp/a.wav", "/tmp/#{x}.wav" ]
sequence(merge=true,
list.append([sine(220.,duration=0.5)],
list.append(list.map(single,l),
[fail()])))
end
output.pulseaudio(fallible=true,prepend(show,intro))
I hope it can be a useful starting point for you. Let me know if this
kind of solution fits your needs.
Cheers,
David
On Thu, Jun 20, 2013 at 11:24 PM, Bill Burton <[email protected]> wrote:
> Hello David,
>
> Thanks for your reply.
>
> Comments inline ...
>
> On Wed, Jun 19, 2013 at 3:02 PM, David Baelde <[email protected]>
> wrote:
>>
>> Hi Bill,
>>
>> Your goal is not an easy one, but that should be doable. I'll try to
>> guide you a bit. First, you need to decide how to insert this
>> introduction file before your shows (either live or replays). I see
>> two ways. You could prepend the intro before launching the show, and
>> in that case you should look at prepend(). Or you could superpose/mix
>> the intro while the show starts, which you could do using a
>> (smart)cross() transition.
>
>
> Actually, there are no shows involved (as far is this functionality goes).
> This is a client side application that would primarily be used to record a
> live show. Think it should be sufficient to use sequence() to play the
> generated intro followed by in().
>
> For existing recordings, I would be happy to have just enough liquidsoap to
> dynamically create the intro in a file by itself. Then I could manually with
> other tools prepend it to the existing recording since then I can avoid
> reencoding the original file and losing quality in the process.
>
> So all I need is a function generate_intro() that can take an optional date
> parameter (defaulting to today's date) and returning a stream that has the
> dynamically generated intro with static recording and date recording parts
> combined. Then I should be able to use it something like this:
>
> s = sequence([ generate_intro(), in() ])
>
> output(%mp3(...), s)
>
>
> Provided Ctrl+C can properly close the file being recorded, that's fine.
> I've written custom commands to start/stop the recording via telnet but
> that's not an absolute requirement.
>
> I saw in another post you used playlist.parse() to test a huge playlist so
> I'm wondering if that could be used to convert a playlist to a hash or other
> usable format that would support dynamically accessing certain entries in a
> playlist?
>
>>
>> It's not only a matter of taste: I suspect that the second solution is
>> easier, because it will be more tolerant to the time it takes to
>> prepare the intro files. If you go for prepending, then you'll provide
>> prepend with a function that builds the source producing the intro,
>> and you have to make sure that the intro track is immediately ready in
>> that source, otherwise it will be skipped. Depending on how you
>> actually prepare the intro, it may force you to wait that one or
>> several requests are ready in the construction function, which will
>> block streaming -- scary. Also, prepending will delay the live show,
>> and if it delays it too much some data may be dropped from the live
>> source's buffers -- you can't delay live stuff that easily.
>
>
> Based on what I mentioned previously, all that would happen is when
> recording is started, the generated intro would be output first taking maybe
> 10-15 seconds and then the input switches to the sound card via in().
>
>>
>>
>> So I would go with cross() or smartcross(). Try playing with them to
>> unconditionnally insert one file as an intro, then try several files.
>> Finally you can try making this file selection dependent on metadata.
>>
>> Regarding the cookbook, I know it's not ideal.. but that's pretty much
>> all we have for now. The scripting language is not OCaml, it's our own
>> for various reasons. And currently I don't know of any tuto outside of
>> our docs. The mailing list itself is kind of a huge messy cookbook
>> too, for example I believe we've already discussed metadata-dependent
>> transition functions, notably in *cross().
>
>
> Okay. I've been on the list for a few months but will look some more in the
> Archives.
>
> Bottom line is it seems to me liquidsoap could be a very good tool for
> various types of audio processing tasks that have nothing to do with
> programming live shows. I also have plans to use it for audio relays in and
> out of Airtime and bulk transcoding of files. There seem to be a lot of
> possibilities that could be explored.
>
> Thanks for your help!,
> -Bill
>
>>
>>
>> Cheers,
>>
>> David
>>
>> On Wed, Jun 19, 2013 at 6:16 AM, Bill Burton <[email protected]> wrote:
>> > Hello,
>> >
>> > I'm trying to figure out how to dynamically string together individual
>> > entries on several playlists for the purpose of making an introduction
>> > that
>> > includes a date and prepended to a recording made on the specific date.
>> >
>> > My primary use case is a liquidsoap script that records from the sound
>> > card
>> > and at the start of the file, outputs an introduction that includes the
>> > spoken date of the recording. There is also a backlog of older
>> > recordings
>> > for which I want to prepend the same intro based on the date the
>> > recording
>> > was made.
>> >
>> > I realize that "say:..." could be used but for now this script runs on
>> > Windows where that feature is not available and in any case, I want more
>> > control over the way the introduction and date is spoken by using my own
>> > recordings.
>> >
>> > Have made recordings to three files:
>> >
>> > years.mp3 - current and future years
>> > months.mp3 - twelve months
>> > days.mp3 - 1st - 31st
>> >
>> > Have created a cue sheet for each file to separate out the numbers in
>> > each
>> > file so playlist() should be able to read each file and from that
>> > determine
>> > the elements based on the associated cue sheet.
>> >
>> > What I'm assuming is that if there's a way to convert each playlist to a
>> > hash with the key being the entry name in the playlist from the cue
>> > sheet,
>> > then the key could be used to access the correct recordings dynamically
>> > to
>> > speak the specified date by playing all the entries in the correct
>> > order.
>> >
>> > Maybe there's some better way to organize the recordings to support
>> > this?
>> >
>> > Right now, I'm having trouble understanding the API docs for liquidsoap
>> > without any examples. Also, the Cookbook and examples don't cover a lot
>> > of
>> > Ocaml syntax.
>> >
>> > Are there any particularly helpful sites on learning Ocaml? The few
>> > bits of
>> > code I've tried don't seem to work in liquidsoap.
>> >
>> > My background is mostly Java, Ruby and Perl if that matters at all.
>> >
>> > Thanks for any assistance,
>> > -Bill
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
--
David
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users