Re: [AD] audio recording

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Wed, Jan 4, 2012 at 5:17 PM, Thomas Fjellstrom
<tfjellstrom@xxxxxxxxxx> wrote:
> Though now we have buffers in the sound card/driver, then in things like PA,
> then in allegro, and then again likely in the user code. I'm not sure we want
> to go that route. Remove as many buffers and copying as possible.
>
I agree.

However, ultimately, as long as you can tell Allegro how often to
report new samples and what size of buffer to use, it won't really
matter if Allegro uses an internal or user buffer. e.g., If a person
could inform Allegro to use one 8MB buffer and send an event every
1000 samples, that would be no different from using an external buffer
and pointing Allegro to it.

So the distinction between an internal buffer and user buffer is
almost irrelevant in terms of decreasing the amount copying. But there
are two cases I was trying to avoid:

1) If the buffer is internal, then it is lost when the audio recorder
is destroyed. Thus, you'd have to copy out of the internal buffer into
an external one before you destroyed the recorder. (Or copy real
time.)

2) If you want to record into a buffer that grows as needed, you would
have to copy out of an internal buffer into an external, user-managed
one.

Of course it is possible to prevent copying in those cases even when
using an internal buffer, but it would make the API more complex than
using an external buffer.

But I really don't care much either way; I think the practical
difference is almost negligible.

--
Matthew Leverton




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/