Re: [LAD] mixing while using libao and libsndfile

From: Andrea Del Signore <sejerpz@email-addr-hidden>
Date: Tue May 17 2016 - 11:50:20 EEST

On Tue, May 17, 2016 at 10:26 AM, David Griffith <dave@email-addr-hidden> wrote:

> On Tue, 17 May 2016, Andrea Del Signore wrote:
>
> On Tue, May 17, 2016 at 12:25 AM, David Griffith <dave@email-addr-hidden> wrote:
>> On Mon, 16 May 2016, Andrea Del Signore wrote:
>>
>> > I'm not simply trying to mix two files. My main project is a
>> > game engine in which two sounds are allowed at any one time.
>> > For instance, there can be constant background music punctuated
>> > by sound effects. I can't get these to mix correctly.
>>
>> Hi,
>>
>> in that case you can just skip the right number of frames before starting
>> playing sounds.
>>
>> I modified my code to take the start time for each file and schedule the
>> play time with frame accuracy.
>>
>> http://pastebin.com/0PMyfPvK
>>
>> If you want your timing to be sample accurate the algorithm is a bit more
>> complex.
>>
>
> That won't work. Your code schedules things ahead of time before anything
> else happens. I need to be able to fire off sound effects the instant the
> player does something to cause them. I can't know in advance.
>
> --
> David Griffith
> dave@email-addr-hidden

Yes my code for now implements only your initial request (play 2 sounds
spaced by few seconds), and it shows how to schedule N sound files of
different length at different times.

I'll try to write a simple mixer for my next learning exercise :)

Have a good day,
Andrea

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Tue May 17 12:15:02 2016

This archive was generated by hypermail 2.1.8 : Tue May 17 2016 - 12:15:02 EEST