Cannot set the volume of video files in SugarCube


I have no idea and have not been able to work out a way to set the volume of videos in my games.

I want the audio I am playing, which is a narration, to be at 100% volume and I want the video to begin playing with its volume set to 0.1 or 10%.

I want the sound of the video to be heard but not in a way where it drowns out the narration in the audio file.

Does anyone know how to achieve this?

To preset the volume of any video to any level that you program?


1 Like

Hi there!

Is the video hosted somewhere or is it a local file that will be packaged with the Twine file?

1 Like

I know I’m doing it in Sugarcube, though I can’t remember if I had to install some stuff?

<<audio "ding" play volume .3>>

<<audio "waltzmoderato" volume 0 fadeto 0.70>><<audio "waltzmoderato" loop>>

@HiEv has some audio and video magic

are the ding and waltzmoderato files videos?

precached: <<cacheaudio “ding” “media/ding.mp3”>>

I know I was setting sound volumes and fades for sound, I assume it’s similar for video?

Yeah, so it’s just an audio file. OP is looking to set the volume for a video :stuck_out_tongue: EDIT: cacheaudio allows .mp4 so maybe it works? yup it doesnt work

1 Like
  • volume level: Set the volume of the selected tracks to the specified level. Valid values are floating-point numbers in the range 0 (silent) to 1 (loudest)—e.g., 0 is 0%, 0.5 is 50%, 1 is 100%.

Does a video file behave like an audio track with levels? I’m skimming documentation and realize I don’t know how video is implemented.

Aha: HiEv explains on Reddit


I just tested it with a rando video file, and it’s how I suspected: the <<audio>> macro… only takes the audio part of the file, not the video. :confused:

bookmarking this for myself