I found out a little while ago that the answer to my question is ocaml-mm,
and to use the add function in the Audio module. There is an example of
this in liquidsoap's add operator in src/operators/add.ml.
I am wondering if anyone knows why the audio mixer is simply adding the two
floats, rather than using the typical audio mixing formula of
mix f1 f2 = f1 +. f2 -. f1 *. f2
which equalizes the volume so that it doesn't grow unnaturally louder with
more pieces of audio mixed in.
-mike
On Thu, Nov 8, 2012 at 3:30 PM, Mike MacHenry <mike.mache...@gmail.com>wrote:
> Thanks for your replay, Romain.
>
> Yes I deblieve that what I posed is a simple problem that the liqid soap
> langauage could solve. It is, however, only the small core of my program.
>
> In my final product I will have a stream running as a separate process and
> responding to updates made via web sevices (presumably passed to the stream
> via dbus) at which point the stream will query a sql database to retrieve
> any filenames that it should play. The stream is also responsilbe for using
> an icecast admin library to check if it is being listened to and also
> keeping state for the most recent messages sent, both of which control
> whether the stream choses to stop and clean itself up from the icecast
> source.
>
> This all seems a bit over complicated for my original post but necessary
> to justify why I don't feel like a web radio DSL is appropriate for the
> task. Perhaps I am wrong. Liquid soap is surprisingly powerful. Though even
> if its capable, ocaml itself might be less work for something this custom.
>
> The underlying libraries in savonet seem like they would be prefect. So
> the core of my new project is essentially some object that will be
> initialized with a source name and contine to play an audio stream to that
> source on an ice cast server.
>
> The object will have a method... playFile, which will add some ogg, mp3,
> or wav to the stream and it will have parameter for where in the file to
> start, stop, and how long to fade in and out. I should be able to call
> playFile again and again and files will be mixed and play on top of each
> other.
>
> Clearly I will be implementing (or likely reusing) some scheduler of async
> calls like gobjects main loop and timeout_add, ect.
>
> I believe that the afforementioned class at the core of this
> eventually-less-simple project will be pretty easy to write using savonet.
> I just can't seem to find a library that does mixing of files I would read
> from, say, libsndfile easily. Pulseadio, jackaudio, and sdl seem to want me
> to buy the whole farm when it comes to those libraries goals. None of which
> match my own of stream many random files on top of one another.
>
> I think I'm missing something about these libraries and I'm really hoping
> someone here can tell me a library and a few function names that are likely
> what I'm looking for here.
>
> Thanks a bunch,
> -mike
> On Nov 8, 2012 3:04 PM, "Romain Beauxis" <to...@rastageeks.org> wrote:
>
>> Hi Mike!
>>
>> 2012/11/7 Mike MacHenry <mike.mache...@gmail.com>:
>> > I am looking for advice on what libraries from Savonet I can use for a
>> > project I'm working on. Here is a simplified version of what I want to
>> do.
>> >
>> > I want to write a program that takes list of ogg, wav, or mp3 files and
>> > plays them to an Icecast stream. Files will be randomly selected,
>> played not
>> > in their entirety but some segment, faded in and out, panned, and many
>> files
>> > can play at once.
>>
>> This should all be possible with liquidsoap, although some features
>> may require relatively advanced knowledge of the language.
>>
>> > I found Liquid Soap and Savonet and I think it's probably a great set of
>> > libraries for the job. I have been looking around at the various
>> documentary
>> > pages for the libraries in Savonet and I have been unable to find a
>> simple
>> > mixer library, which I'm sure must exist.
>> >
>> > PulseAudio, JackAudo, and SDL all seem like they clearly mix audio, but
>> I
>> > think Pulse really needs to interface the Linux sound system, Jack
>> requires
>> > me to use it to tie together multiple process, and SDL seems to want to
>> > connect to audio devices, whereas I want to stream.
>> >
>> > Does anyone have recommendations on what libraries I should be focusing
>> on
>> > learning to write something like this? Perhaps one of those three
>> actually
>> > has all the capabilities I need.
>>
>> I am wondering why do you need a mixer library for? If by this you
>> mean that you want to merge two different tracks into one then this
>> should be possible using liquidsoap it self. For instance in the
>> following snippet:
>>
>> # One source
>> source1 = (...)
>>
>> # Another source
>> source2 = (...)
>>
>> # Mix those two sources together
>> mixed = add([source1, source2])
>>
>> Is that what you need?
>>
>> Romain
>>
>
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users