Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
How to impliment ISoundStopEventReceiver

Fair
Guest
Quote
2016-04-08 19:57:38

Hello,

Sorry for what is probably a rookie question but how would I get notified of the end of the sound being played to then do something?

Currently I am playing sound this way;

[code foreach (var line in arrays)
{
if (line[0] == "true")
{
this.engines.Add(new ISoundEngine(SoundOutputDriver.AutoDetect, SoundEngineOptionFlag.DefaultOptions, line[3]));
for (int i = 0; i < this.engines.Count; i++)
{
this.engines[i].StopAllSounds();
if (sound != "Stop Playback")
{
this.engines[i].Play2D(sound);
}
}
}
else
{

}[/code]

How would I then use the ISoundStopEventReciever to perform a task when the sound ends?

Basically I need to simulate a keyboard key press whilst the sound is playing but upon sound finish I need to stop the key press.

Thank you for reading hopefully this makes sense.


erik
Registered User
Quote
2016-04-09 10:21:47

It is much easier to check for isFinished() of the sound from time to time, and then do your stuff. In the callback you would get in the other method, you cannot do a lot of things, because it is in another thread.


Fair
Guest
Quote
2016-04-09 20:08:37

Brilliant.

Thank you! :)


Create reply:


Posted by: (you are not logged in)


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