Menu
Login
Language
DE EN FR ES IT CZ
Back

Verwendung von startSound

  • #1, by constantin Thursday, 26. October 2017, 14:02 8 years ago Quote
    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 afrlme Thursday, 26. October 2017, 14:27 8 years ago Quote
    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

    7290 Posts

  • #3, by constantin Friday, 27. October 2017, 16:13 8 years ago Quote
    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 afrlme Friday, 27. October 2017, 17:46 8 years ago Quote
    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

    7290 Posts