Verwendung von startSound

  • #1, by constantinThursday, 26. October 2017, 14:02 5 years ago
    ich habe probleme, sound per lua zu starten. 
    mein soundfile befindet sich in "Visionaire Games/Fleischtage/Sound/testraum/testsound.ogg". Ich versuche:
    startSound("vispath:Sound/testraum/testsound.ogg")

    ist das korrekt?
    log sagt mir nur, dass der sound nicht abgespielt werden kann. 

    Forum Fan

    167 Posts


  • #2, by afrlmeThursday, 26. October 2017, 14:27 5 years ago
    It's better if you create a Lua table to store sounds into. Alternatively you can also use variables too.

    sndz = 
    {
     ["testsound"] = "vispath:Sound/testraum/testsound.ogg",
     ["wilhelm"] = "vispath:Sound/testraum/wilhelm.ogg"
    }
    
    startSound(sndz["testsound"])


    Something along the lines of that.

    Imperator

    7138 Posts

  • #3, by constantinFriday, 27. October 2017, 16:13 5 years ago
    thank you. the problem was, that i wanted to play it "at begin of scene". it didnt play, no matter what i typed. after setting a small pause of 50 ms it works. guess visionaire was too fast :-) 

    Forum Fan

    167 Posts

  • #4, by afrlmeFriday, 27. October 2017, 17:46 5 years ago
    Ah yeah, you need to add a pause in at begin of scene action part as some things require the scene to load first.

    Imperator

    7138 Posts