I'm trying to load a sound with irrKlang library and it works fine at playing, but I want to get PlayLength()
and PlayPosition()
properties but program crashes when done. This is what I do:
#define ResX "res.mod"
irrklang::ISoundEngine* se = irrklang::createIrrKlangDevice();
if( !se->isCurrentlyPlaying( ResX ) ){
irrklang::ISound *s = se->play2D( ResX, false, false, false );
while( s->getPlayPosition() < s->getPlayLength() ) //Do something
}
When I do s->getPlayPosition()
or s->getPlayLength()
program crashes
I put some clarificaction here first:
I cant use while( se->isCurrentlyPlaying( ResX ) )
because isCurrentlyPlaying
() doesn't return 0 when media stopped playing sometimes.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…