[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rSounds - affect on available free memory
In article <4oi91n$3v1@seeker.the-hermes.net>,
Geoff Weiss <geoff@seeker.the-hermes.net> wrote:
>
>If I remember correctly, Apple gave the reasoning why it works the way
>it does. What happens if you assign the same sound for startup as you
>do for something else such as system beep. If you remove the sound from
>memory, you will start corrupting memory.
The Sound Manager only reads waveforms from memory. Careless software
might cause the speaker to play garbage, but main memory should remain
intact.
Since system sounds are stored as resources, I thought for sure that the
system was calling ReleaseResource when it was through playing a sound.
That way, the sound would be purged if necessary, and cached in RAM
otherwise. But I noticed the same memory munching problem that Mitchell
Spector described, so my days of happily assigning sounds to every
possible event are over.
I can see where calling ReleaseResource for system sounds might be an
awkward programming problem, since the playing of sounds is asynchronous.
You'd have to be careful not to release a sound before it was finished
playing. At the same time, you wouldn't want to wait for a given sound to
finish before returning from SysBeep, just so you could call
ReleaseResource.
--Leif