Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Unhandled exception in irrKlang thread

keycode13
Guest
Quote
2016-02-25 16:04:08

Hello,

I have a strange issue concerning playing a new sound from OnSoundStopped.

I have a method that starts playing a new sound, which I call identically from two different threads. When I call it from my main thread it works as expected, however when it's called from the OnSoundStopped method, it gives me the following error "Unhandled exception at 0x00007FFC6F25C658 (irrKlang.dll)" the source of it is the irrKlang thread. The method is executed, the error occures right after.

I'm using the unlicensed x64 version, IDE: VisualStudio 2015 Community, OS: Win10 x64. The engine runs in multithreaded mode.

I will provide any additional info if needed.
Thanks in advance


The method I'm calling:

int MusicPlayer::playNextMusic(int n) {
cout << "Playing " << (n >= 0 ? (n == 0 ? "current" : "next") : "previous") << " music\n";
if (now_playing)
now_playing->drop();
engine->removeAllSoundSources();
current_music = engine->addSoundSourceFromFile(playlist->getNextMusic(flags, n));
if (!current_music) {
cout << "Failed to load current music\n";
return 0;
}
now_playing = engine->play2D(current_music, false, false, true);
if (!now_playing) {
cout << "No music to play\n";
return 0;
}
now_playing->setSoundStopEventReceiver(stopHnd, this);
return 1;
}

variables:

ISound* now_playing
ISoundEngine* engine
ISoundSource* current_music
stopHnd: an instance of my implementation of ISoundStopEventReceiver
playlist->getNextMusic() returns char*



niko
Moderator
Quote
2016-02-26 08:03:43

Don't start new sounds inside that function. Better is to record that you want to start a new sound inside that function, and then start the sound in the main thread again, which originally started irrklang. This should solve the problem.


keycode13
Guest
Quote
2016-02-26 11:13:57

Thanks for the reply, could you please include this information in the documentations, if it's not a system specific problem?


niko
Moderator
Quote
2016-02-28 14:09:38

Yep, going to do (I think something like this is written somewhere in there, but I also didn't find it with just quickly searching for it.)


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (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