0 votes
by (120 points)
reshown by
Hello!

First of all: I use the current version of Twine (2.2.1) and SugarCube 2. And I've read the audio macro list, but I still don't understand how to do that.

What I want is to fade out whichever audio file is currently playing while starting to play a new one. A simple transition, basically. But apparently you can't use "fadeout" for whole audio groups, just for playlists. So what I tried is creating a playlist with every audio file in it (in StoryInit as recommended) and then say in the passage: <<playlist "AllCachedAudioFiles" fadeout>> <<audio "NewAudioFile" play loop>>

It doesn't work, it doesn't fade out. Could it be that it doesn't work because "NewAudioFile" is also within the "AllCachedAudioFiles" playlist?

1 Answer

0 votes
by (68.6k points)

I'm unsure how you got that the fadeout action was only usable with playlists.  The <<audio>> macro documentation clearly lists it as an available action.

Regardless.  To fade out all currently playing audio, which hasn't been copied into a playlist, and also start a new track playing looped, you want something like the following:

<<audio ":playing" fadeout>><<audio "track that is not playing" loop play>>

 

Also.  Do not confuse playlists, created with the <<createplaylist>> macro, with either the built-in groups or custom groups, created with the <<createaudiogroup>> macro.  A playlist is a queue of tracks to play in some sequence, controlled via the <<playlist>> macro.  A group is simply a list of tracks which allow you to issue commands to multiple tracks simultaneously, controlled via the <<audio>> macro.

...