Re: [linux-audio-dev] memory management

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] memory management
From: Josh Green (jgreen_AT_users.sourceforge.net)
Date: Mon Nov 26 2001 - 00:38:20 EET


On Sun, 2001-11-25 at 13:04, Christophe Baillon wrote:
> Hi,
> I am about to begin a project of a sound editor written in Ada. I've got
> a question about memory management of samples.
>
> To treat big samples (40Mo for example) is it judicious to load the
> whole file in only one buffer ?
> If i want to insert an other sample of 5 Mo in the medium of the buffer,
> should i cut the sample into a linked list of block memory, or should i
> make a realloc() and a displacement of data in the block ?
>
> Is there interesting link on the web about algorithms used by sound
> applications ?
>
> Thanks.
>

I'm no expert on audio editors, I'm sure there are some lurking on this
list though.
If you are planning on editing very large files, I would say no, you
shouldn't load the entire sample in memory. I think one of the best
editing techniques I have heard of is EDL lists. The basic concept is
that the audio data is never actually changed, a list of edit operations
is kept instead that defines what changes have been made. An example
would be if the user cut a block of audio out of a file you could just
store the type of operation, CUT in this case, the start position in the
sample, and the size of the cut. When redisplaying the audio sample the
EDL list is taken into account. This also makes undo and redo operations
very easy as you simply have to add or remove items from the EDL list.
When the user wants to apply an effect that isn't so easy to do in real
time, the audio can be rendered to disk which means all the edit
operations are applied and the resulting data is written to another file
(retaining the original audio). EDL lists is what broadcast 2000 uses
(too bad its no longer being developed), ardour and glame I believe as
well.

-- 
    Josh Green
    Smurf Sound Font Editor (http://smurf.sourceforge.net)


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Nov 26 2001 - 00:31:17 EET