Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

SugarCube 2.13.0 — controlling all playing audio and making it fade out?

From the documentation I see that there's ways to play, pause, and stop audio through the group IDs, but do the other commands work for those group IDs as well? I'm trying to fadeout all playing audio rather than hard-code the fadeout by hand but this:
<<audio ":playing" fadeoverto 3 0>>

doesn't appear to do anything.

Is the playlist method the only way to accomplish this?

Comments

  • They do work with ":playing", both with fadeout and fadeoverto. Maybe double check your surrounding control logic (i.e. did you accidently place the <<audio>> macro in an <<if>> statement or something?).
  • edited February 2017
    mixvio wrote: »
    From the documentation I see that there's ways to play, pause, and stop audio through the group IDs, but do the other commands work for those group IDs as well?
    I assume the confusion here comes from the fact that the code examples for the group IDs only show those actions. The code examples are not meant to be exhaustive—code examples never are, they, literally, cannot be. Case in point, the examples don't show uses of the :looped and :muted group IDs at all, yet that should not be taken as confirmation that they do not function.

    All actions should be available to all track IDs, including group IDs, except where specifically noted—more on that below.

    mixvio wrote: »
    I'm trying to fadeout all playing audio rather than hard-code the fadeout by hand but this:
    <<audio ":playing" fadeoverto 3 0>>
    
    doesn't appear to do anything.
    If you have tracks playing at that point, then that should have worked upon them. The only exceptions should be if either the playing tracks are playlist copies or you've found another browser snafu—though I just tested in all of the major browsers and it seems to be working as intended in all of them.

    If the playing tracks are not playlist copies, then we have a conundrum and I need to don my deerstalker.

    If the playing tracks are playlist copies—meaning those set up via <<createplaylist>> with its copy action or all tracks set up via, the deprecated, <<setplaylist>>—then the documentation for <<audio>> clearly notes that they will not be affected by group IDs—although, it should actually say that they will not be affected by the <<audio>> macro at all; I'll clear up the docs there. As to why, each playlist copy is an independent copy of the track in question which is solely under the control of its playlist. Just in case that's tripped you out, I've gone ahead and cleared up the documentation for all of the macros involved.
  • Nope, they aren't in a playlist at all so it sounds like it's another bug again. I did this in the web2exe wrapper using nwjs 0.21.0-rc1. Whatever version of Chromium that is.
  • mixvio wrote: »
    Nope, they aren't in a playlist at all so it sounds like it's another bug again. I did this in the web2exe wrapper using nwjs 0.21.0-rc1. Whatever version of Chromium that is.

    That's a hot-off-the-presses beta version. Any reason you're using that instead of a stable NW.js release?

  • Chapel wrote: »
    That's a hot-off-the-presses beta version. Any reason you're using that instead of a stable NW.js release?

    It's what web2exe updated me to on its own. I went back and rebuilt it against 0.19.1, which was the last stable version I didn't have problems with, and that worked fine but for good measure I tried again with the latest version that it used previously and it worked as well.

    ¯\_(ツ)_/¯

    I have found audio can be a bit finnicky so maybe it was just a glitch on my end. I don't even know anymore.
  • mixvio wrote: »
    I did this in the web2exe wrapper using nwjs 0.21.0-rc1.
    You should include important information like that in your original post, knowing you are using a custom web-browser (and a beta one at that) can make a difference to answers given.
  • Web2exe just sounds like it has you a bit too far on the cutting edge. That nwjs version is a beta of a beta (the chromium version it uses is also in beta). Maybe try nw-builder?

    If it works it works though. No reason to rock the boat now I guess.
  • Chapel wrote: »
    Web2exe just sounds like it has you a bit too far on the cutting edge. That nwjs version is a beta of a beta (the chromium version it uses is also in beta). Maybe try nw-builder?

    If it works it works though. No reason to rock the boat now I guess.

    I hadn't heard of nw-builder, although web2exe has its own GUI which makes this all a lot easier to do. It sometimes switches the nwjs build on its own if I haven't moved to a more recent version in a while, but I didn't realise it was also building against a beta of Chromium as well.
Sign In or Register to comment.