• 0

    posted a message on How to stop a sound played from API PlaySoundFile File path
    Quote from Ketho17 >>

    You need to use the handle returned from PlaySoundFile() for StopSound(), for example this stops the levelup sound after half a second

    /run local _, handle = PlaySoundFile(569593); C_Timer.After(.5, function() StopSound(handle) end)

     Ketho17, it worked! Thank you so much.

     

    So in my script I do not use /run, as far as I understand that is for macros only. Is that correct?

    But what I did was set two local variables at the top (used them like normal global variables (gross, but what can you do), had them set by the function called when the QUEST_DETAIL event fired, and when the QUEST_FINISHED event fired, I used that same variable to stop the sound. 

     

    I was unaware that lua returned multiple variables, that is pretty neat. Anyway, thanks again for the help!

    Posted in: AddOn HELP!
  • 0

    posted a message on How to stop a sound played from API PlaySoundFile File path

    In reply to Ketho17:

     I'll give it a shot and report back. Thank you for your time and response.

    Posted in: AddOn HELP!
  • 0

    posted a message on How to stop a sound played from API PlaySoundFile File path

    Hello I am making a personal addon which will play a custom mp3 sound file using the API PlaySoundFile . 

    The problem I am having is that using API StopMusic does not stop the sound file. Neither does StopSound or MuteSoundFile.

    Now, I see that StopMusic and StopSound do not have a file path or any way to specify which file is playing, but MuteSoundFile does.

    However, when I use MuteSoundFile and use the same file path used to play it, it does not stop. 

     

    Can anyone help me stop a custom mp3 sound started by PlaySoundFile?

    Posted in: AddOn HELP!
  • To post a comment, please or register a new account.