News:

SMF - Just Installed!

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Kotomin_Nikita

#1
Audio editing components / Thread blocking Playback
June 17, 2016, 05:24:12 PM
Hello.
Is there a way to play sound with audioEditorAPI.PlaySound() in such way that the current thread will be blocked till the playback is done?
Now I use construction like this

audioEditorAPI.PlaySound();

//Wait until playback finishes
while (audioEditorAPI.GetPlaybackStatus() != enumPlaybackStatus.PLAYBACK_STOPPED)
{
    System.Threading.Thread.Sleep(200);
}

audioEditorAPI.LoadSoundFromMemory(sound, sound.Length);
audioEditorAPI.PlaySound();


I need to play sounds in loop one after the other. What is the best way to accomplish this?
Thank you.