Hi, you are simply using the engine a bit wrong here
addSoundSource only returns the pointer of the added sound source when it was added the first time. It also should only be called once. Second: There is no need to drop() the pointer. More exactly: you must not drop() the pointer there, it will crash the engine.
So what you want to do is
Code: Select all
do {
engine->play2D("../../media/bell.wav");
} while(getch() != 'q');
which would work, or if you really want to use sound sources do something like this:
Code: Select all
ISoundSource* Snd = engine->addSoundSource("../../media/bell.wav");
do {
engine->play2D(Snd);
} while(getch() != 'q');
And if you need to reload your sound after every playing, add this:
Code: Select all
ISoundSource* Snd = engine->addSoundSource("../../media/bell.wav");
do {
engine->play2D(Snd);
if (Snd)
Snd->forceReloadAtNextUse();
} while(getch() != 'q');
Hope this helped.