Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
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. |
||||
|
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. |
||||
|
Brilliant. Thank you! :) |
|