How to kill a 3D sound buffer?!? (resources question) 
Author Message
 How to kill a 3D sound buffer?!? (resources question)

I've noticed that if I create 3D sound buffers in my VB6
apps using DX8.1 that I can't seem to release them and
reclaim the resources, i.e. to get rid of unused sounds
and recycle them for new sounds.  Even reloading the
buffer using the CreateSoundBufferFromFile seems to not
do the trick.

Eventually, the 3D sound buffers just become 3D emulated
stereo buffers.

So, I ask.. is there a way to totally kill off a 3D sound
buffer and release those resources to be re-used during
execution?

Thanks in advance,

James



Tue, 11 Oct 2005 03:34:17 GMT  
 How to kill a 3D sound buffer?!? (resources question)
James-

I assume that you're talking about the DirectSoundSecondaryBuffer8 object
that is associated with the DirectSound3DBuffer8 object.  When you set the
variable referencing the DirectSoundSecondaryBuffer8 to "Nothing", then the
object should be orphaned, and should be consumed by the garbage collector.
So, play a sound, wait until done, then set the buffer reference to Nothing,
and the RAM should be released, though it might not happen right away --
can't remember exactly how VB garbage collection works.

You can similarly dispose of the DirectSound3DBuffer8, but orphaning it will
not release the DirectSoundSecondaryBuffer8 object that it controls.  Since
the DirectSound3DBuffer8 object still holds a reference to the
DirectSoundSecondaryBuffer8 object, you may need to dispose of both of them
in order for the secondary buffer to be completely orphaned.

Hope I didn't miss your meaning in this question.  If you do all of this,
and the RAM will still not be released, would you tell me the way that
you're determining the buffers that are responsible for the memory
consumption?

BTW: Looking forward to Raceway.

--
Bryan Smart - MCSD
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:

> I've noticed that if I create 3D sound buffers in my VB6
> apps using DX8.1 that I can't seem to release them and
> reclaim the resources, i.e. to get rid of unused sounds
> and recycle them for new sounds.  Even reloading the
> buffer using the CreateSoundBufferFromFile seems to not
> do the trick.

> Eventually, the 3D sound buffers just become 3D emulated
> stereo buffers.

> So, I ask.. is there a way to totally kill off a 3D sound
> buffer and release those resources to be re-used during
> execution?

> Thanks in advance,

> James



Tue, 18 Oct 2005 05:13:05 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. 3D Sound Buffer Errors Under Windows 2000

2. 3D Sound Positioning Math Question

3. Directx7 for sound buffering

4. Sound buffering

5. Regarding opening up realtime buffer for sound device

6. DirectSound8 Get Spectrum from Sound Buffer

7. Play Sound from buffer?

8. 3D Graphics - DirectX - Sound - Under Visual Basic

9. 3D Graphics - DirectX - Sound - Under Visual Basic

10. 3D Graphics - DirectX - Sound - Under Visual Basic

11. 3D Graphics - DirectX - Sound - Under Visual Basic

12. 3D Graphics - Wave Sound - DirectX - Under Visual Basic

 

 
Powered by phpBB® Forum Software