• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

No Sound played

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2013
Messages
1,105
Hello, I'm using the below function to create an error message but its not playing the sound, From my limited JASS knowledge it appears to me that the sound is created and stored on initialization. However, its not working so maybe I'm supposed to be doing something else to create/store the sound?

JASS:
library SimError
//==================================================================================================
    globals
        private sound error
    endglobals
    //====================================================================================================

    function SimError takes player ForPlayer, string msg returns nothing
        set msg="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+msg+"|r"
        if (GetLocalPlayer() == ForPlayer) then
            call ClearTextMessages()
            call DisplayTimedTextToPlayer( ForPlayer, 0.52, 0.96, 2.00, msg )
            call StartSound( error )
        endif
    endfunction

    private function init takes nothing returns nothing
         set error = CreateSoundFromLabel("InterfaceError", false, false, false, 10,10)
    endfunction

endlibrary

Edit: I triple checked my sound, so I am certain that is not the problem
 
Status
Not open for further replies.
Top