Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
How to properly remove a soundsource

xmdeveloper
Registered User
Quote
2015-11-16 13:53:02

Hello,

Quick question:

I am receiving PCM data in chunks, which I am playing with:

g_SoundSource = engine->addSoundSourceFromPCMData( .. );
g_ISound = engine->play2D( g_SoundSource, false, true, true );

When I detect g_ISound->isFinished(), I do:

g_ISound->drop();
engine->removeSoundSource( g_SoundSource );

and then re-create the sound source as above with new data.

My question: Do I need to call g_SoundSource->drop();

after the ->removeSoundSource call? Or does removeSoundSource() take care of that?

Since I'm deleting and then re-creating sound sources, I don't want to end up with a memory leak :)

Many thanks for any help!


niko
Moderator
Quote
2015-11-18 06:49:24

Yes, you don't need to drop. It's fine that way. It also is written somewhere in the docs. :)


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internatio?al" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact