Can we free those memory?
Posted: Sat Sep 27, 2008 5:18 am
I'm using IrrKlang. Everything seems fine when I play the sound. But there's one thing. The number of memory usage rocket up everytime the sound play.
Just load and play it. I've read something about "stop" but how to use it ?
This problem is affected to mesh file. When I load my level on the scene and change map (delete old scene) the memory usage doesn't decrease. Also AVI file when I play it for second time and memory usage is rising up! Am I do anything wrong with those pointer ?
This problem occur even in IrrKlang Example itself.
This is my full class of sound effect.
Maybe just like
fx1.load(somefile);
fx1.play();
fx1.del()
????
Code: Select all
sp = Sfx->play2D(music);
This problem is affected to mesh file. When I load my level on the scene and change map (delete old scene) the memory usage doesn't decrease. Also AVI file when I play it for second time and memory usage is rising up! Am I do anything wrong with those pointer ?
This problem occur even in IrrKlang Example itself.
This is my full class of sound effect.
Code: Select all
class SoundEffect
{
public:
ISoundSource* music;
ISound* sp;
bool is_stop;
char *files;
float Volume;
// Set Sound
void Load(char file[50]){
files=file;
music = Sfx->getSoundSource(file);
Volume=1.0f;
}
void Del(){
sp->stop();
}
// Stop Sound All
void Stop(){
Sfx->stopAllSounds();
}
// Play Sound
void Play(){
sp = Sfx->play2D(music);
Sfx->setSoundVolume(Volume);
}
// Set Volume take 0-100
void SetVol(int rate){
Volume=rate/100;
}
};
fx1.load(somefile);
fx1.play();
fx1.del()
????