I’m trying to make a program that, among other things, syncs audio with the playback (similar to to AAE). The best I’ve been able to do was have it invert the pause/play when you run the PlayAnimation command. This gets out of sync really easily, as there are a lot of other things that cause it to pause (such as editing or closing the image).
Realizing I should probably include a snippet of my code.
ase.app.events:on('beforecommand', function(ev)
if ev.name == "PlayAnimation" then
playing[lastSprite] = not playing[lastSprite]
updatePlayingState()
end
if ev.name == "CloseFile" then
playing[lastSprite] = nil
command('setaudio', '')
updatePlayingState()
end
end)
updatePlayingState syncs with the host on whether to play the audio based on the playing table (using command("setplaying", true/false)), and ase is a reference to _G to make EmmyLua happy.