Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

Sound Bug Using "Set Fade Effect To New Scene"

  • #20, by SDMono 12 years ago Zitieren
    Can it be that local sound1 = "vispath:data/audio/tellisis/sounds/song.ogg" is just a local variable and thats why I cannot call it from another script?
  • #21, by afrlme 12 years ago Zitieren
    ah yeah smile

    sorry... I tend to work with functions inside of same definition script which is why I use local quite often.

    I think a good idea for you to do is for you to create a table & add all sounds into that you want to play via the startSound function at some point in the game...
    tSnd = {}
    tSnd["bgmusic1"] = "vispath:path_to_sound.ogg"
    tSnd["sfx1"] = "vispath:path_to_sound.ogg"
    etc...
    

    That way you can call them whenever you like, like so...
    startSound( tSnd["sfx1"] )
    
    getSoundId( tSnd["sfx1"] ) -- sound has to be active to return sound id
    

    Hopefully you will grasp what I'm trying to explain here.
  • #22, by SDMono 12 years ago Zitieren
    Not yet but I will!!! smile Thanks for all your help!!!
  • #23, by SDMono 12 years ago Zitieren
    Ok... got it to work using the table and by saving the offset and letting it start from there in the next scene... but you were right the delay is really noticeable. The ToggleSoundPause idea is not working until now. I think it has to do with the sound not being active... gonna keep on trying!!!
  • #24, by afrlme 12 years ago Zitieren
    you might want to add some flags to your startSound function such as loop=true etc.

    I've not actually tested the sound functions in any of the recent 4.0 betas. Last time I tested them was when we had the 4.8 dev builds before they decided to make the next release 4.0.
  • #25, by SDMono 12 years ago Zitieren
    Ok... going a little crazy here. Like I said before the offset idea worked but it is slightly off and so no use. I really want to get the pause idea to work between two scenes but I cannot do it.

    I can ToggleSoundPause inside of a scene using 3 scripts and calling them when I need them.

    The first one start the sound (which I have inside of a table) like so:
    startSound(tSnd["song"], {flags=1, volume=50, loop=true, offset=10000})
    


    The second script pauses the sound like so:
    set1 = getSoundId(tSnd["song"])
    toggleSoundPause(set1)
    


    The third unpauses the sound like so:
    set2 = getSoundId(tSnd["song"])
    toggleSoundPause(set1)
    


    Like I said all of this works inside of a scene. When I try to put the third script at the beginning of a new scene the sound just wont come back on.

    Any ideas to why this is happening?
  • #26, by afrlme 12 years ago Zitieren
    can you send me the .ved & resource files please? I assume you are still using the test ved thing you linked me the other day?
  • #27, by SDMono 12 years ago Zitieren
    Ok, here it is... I changed the sound to a song so it is easier to hear the pause and unpause. I also added two buttons to the first scene where you can pause and unpause the sound.
  • #28, by afrlme 12 years ago Zitieren
    ok will have a look the morrow afternoon & get back to you. wink
  • #29, by SDMono 12 years ago Zitieren
    I just made another version... just two scripts and one button that toggles the sound on and off. Still not luck when changing the scene though.
  • #30, by afrlme 12 years ago Zitieren
    here I've removed your scripts/actions & edited with my own script & execute a script action parts.

    http://www.sendspace.com/file/nxumaj

    This is just a very basic example. I am thinking about creating a .ved file at some point that showcases the Lua sound functions. No idea when I will get around to it though.