Howdy, Stranger!

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

Fading Out Audio without Replaying Sound


I'm new to this forum and relatively new to twine so any aid would be greatly appreciated. I'm using Twine 1.4.2 and my story is in Sugarcube format.

I have figured out how to put audio into the story via referencing it on the internet and how to fade it in but when I want to fade the audio out it restarts the sound before doing so.

Is there anyway to fade out a track already playing?



  • And you're playing the audio how exactly?
  • I start the audio by doing <<audio "SoundName" fadein>> then <<audio "SoundName" loop>> to loop it. I'm trying to fade it out with <<audio "SoundName" unloop>><<audio "SoundName" fadeout>> I've tried it without the loop stuff too to no avail. I can't get it not to restart the track before fading it out no matter what I try.

    Sorry, should have been more specific in my original post.
  • edited October 2015
    First off, which version of SugarCube?

    Secondly, you may combine actions within a single invocation of <<audio>>, so you don't have to separate them as you're doing now. IOW, you can do things like the following:
    <<audio "SoundName" loop fadein>>
    <<audio "SoundName" unloop fadeout>>
    The examples in the documentation are fairly clear about that.

    Finally, if the track is still playing when you invoke the fade out, then there should be no reason for the audio to restart (it should be impossible, really). How long is the audio you're trying this with? When and how are you invoking the fade out?
  • I'm using Sugarcube-1

    I've changed it to be combined now, and still having the same issue so that wasn't the culprit.

    The track is 2 min 52 secs. I start it on one passage via <<audio "SoundName" loop fadein>> then have it loop for a couple passages until it reaches the passage where I'm trying to have it fade out with <<audio "SoundName" unloop fadeout>>

    I'm referencing the audio from the StoryInit passage with <<cacheaudio "SoundName" "link.mp3">> if that helps
  • I didn't say issuing the actions with separate invocations was a problem, I simply said it was unnecessary.

    Which browser have you tested in? Can you create a demo showing the problem in action?
  • Also, are you issuing any other audio actions to that track at any point during this process? Primarily, I'm thinking of the stop and/or time actions.
  • edited November 2015
    After making the example I discovered once I uploaded the html file to a site like philome and looked at it on chrome the audio acted liked it was supposed to. In the end, thanks to you, I discovered it has something to do with Internet Explorer, which was my default preview program, because the audio works fine on Chrome and Firefox.

    Thanks for your help!
  • Tests in IE and Edge…. Oh, what a frabjous day! Microsoft browsers being difficult, how novel an experience this is. /sigh

    I'll be updating both versions of SugarCube to work around this latest inanity from Redmond. You'll want to update your version of SugarCube (once the updates are published) and rebuild your story to get the workaround.
Sign In or Register to comment.