AddOns
Latest 200
AddOn Manager
Browse
Upload AddOn
Search AddOns
Projects
Author Portals
Git Repositories
SVN Repositories
Options
Email Feeds
Preference
Download History
News
Forums
New posts
Today's Posts
Search Forum
Categories
General
AddOns
Developer
Site Forums
Mark Forums Read
Subscribed Threads
Open Buddy List
Members List
Wiki
Help
Login
Sign up
ESOUI
»
Developer Discussions
»
General Authoring Discussion
»
Detect when SoundPlay complete it's task
Go to Page...
Reply
Thread Tools
Display Modes
10/14/17, 04:38 PM
#
1
Hell4Ge
Join Date: Oct 2017
Posts: 3
Detect when SoundPlay complete it's task
This code represents the problem that I am facing now:
SetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO, 1)
PlaySound(SOUNDS.EMPEROR_CORONATED_DAGGERFALL)
SetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO, 0)
The sound will be played, but I won't be able to hear it as the 3rd line executes instantly
Any solution for this?
Edit: I am looking now at
http://esoapi.uesp.net/current/src/l...layer.lua.html
Last edited by Hell4Ge : 10/14/17 at
04:42 PM
.
Hell4Ge
View Public Profile
Send a private message to Hell4Ge
Find More Posts by Hell4Ge
10/14/17, 04:55 PM
#
2
Dolgubon
Join Date: Jan 2016
Posts: 410
I can't seem to find a function for sound length or a sound complete event, so what you can do is first test how long the sound takes to play, and then use zo_callLater(function() changeSetting end, delayInMilliseconds)
Dolgubon
View Public Profile
Send a private message to Dolgubon
Find More Posts by Dolgubon
10/14/17, 07:01 PM
#
3
Hell4Ge
Join Date: Oct 2017
Posts: 3
I have found a solution
function onSoundFinishedTurnOffBackgroundAudio()
SetSetting(SETTING_TYPE_AUDIO, AUDIO_SETTING_BACKGROUND_AUDIO, 0)
end
local alertSound = ZO_QueuedSoundPlayer:New()
alertSound:SetFinishedAllSoundsCallback(onSoundFinishedTurnOffBackgroundAudio)
alertSound:PlaySound(SOUNDS.EMPEROR_CORONATED_DAGGERFALL, 3000)
Hell4Ge
View Public Profile
Send a private message to Hell4Ge
Find More Posts by Hell4Ge
Reply
ESOUI
»
Developer Discussions
»
General Authoring Discussion
» Detect when SoundPlay complete it's task
«
Previous Thread
|
Next Thread
»
Thread Tools
Show Printable Version
Email this Page
Display Modes
Switch to Linear Mode
Hybrid Mode
Switch to Threaded Mode
Posting Rules
You
may not
post new threads
You
may not
post replies
You
may not
post attachments
You
may not
edit your posts
vB code
is
On
Smilies
are
On
[IMG]
code is
On
HTML code is
Off