Candy Logo Copyright © 2025-2026 Candy Arts

Media Volume
In this tutorial, you will learn to change the volume of a sound, at once or progressively, with the Media_Volume command. Alice closes the window, and the birdsong fades down. When she opens it again, the birdsong fades back up. Before You Start This tutorial uses the Actors and portraits of the Beginner tutorials: Alice, John and the construction worker. Write its scene in the Dialogue of your choice: the Dialogue of the Beginner tutorials, or a new one (File > New Dialogue). 1. The Sound File Sounds are played by audio players. The dialogue UI provided with Candy Dialogue Engine contains several of them, and this tutorial uses the one named Ambient, for background sounds: the AmbientPlayer node of the dialogue UI scene. Each player plays the files of a folder named after it: the Ambient player's files are in Candy_DE/Media/General/Audio/Ambient. The birdsong, Birds.ogg, is already in that folder: it's part of the Media folder copied in the Dialogue tutorial. It lasts twenty seconds, and loops without a gap. 2. Writing the Scene 1. Add a Conversation named "Window", as in the Conversations tutorial. 2. In its Block_1, add four Spoken Lines, then an End command after the last one:
SpeakerPortraitText
AliceSkeptical.pngThose birds are so loud this morning. Let me close the window.
John(empty)Much better. I can finally hear myself think.
Alice(empty)On second thought, I miss them.
AliceHappy.pngThere. Spring is back.
The birdsong starts before the first Line, with a Media_Play command. A new command is added after the selected Line: to add one at the very start of the Block, add it after the first Line, then drag it above that Line in the Dialogue Navigator. To play the birdsong: 1. Select Alice's first Line, "Those birds are so loud this morning. Let me close the window." 2. Open the Media tab of the Buttons panel, and click Media Play. 3. In the Field Tree, on the left of the form, click + Player. 4. In the name field, at the top of Player 1's fields, replace "Player_1" with "Ambient", or click the field's v button and select Ambient in the list. 5. Click the v button of the File field, and select Birds.ogg. 6. In the Loops field, write "-1", or click the field's v button and select Loop forever. 7. Drag the Media_Play command above Alice's first Line, in the Dialogue Navigator. 3. Lowering the Volume 1. Select Alice's Line "Those birds are so loud this morning. Let me close the window." 2. In the Media tab of the Buttons panel, click Media Volume. 3. In the Field Tree, click + Player. 4. In the name field, replace "Player_1" with "Ambient", or select Ambient in the list of the field's v button. 5. In the Volume field, write "-15". 6. In the Time field, write "2".
Tutorial Media Volume
7. Select Alice's Line "On second thought, I miss them.", and add a second Media_Volume command the same way, with the Volume "0" and the Time "2". How the Volume Works • The Volume is in decibels (dB): 0 is the volume of the file itself, negative values are quieter, and positive values louder. At -15 dB, the birdsong is much quieter, but still audible. • The Volume can also change the current volume: "-=6" lowers it by 6 dB, and "+=6" raises it by 6 dB. • The Time is the length of the fade, in seconds: the volume changes progressively over 2 seconds. A Time of 0 changes it at once. The Dialogue doesn't wait for the fade: John's Line is displayed while the birdsong fades down. 4. Testing the Scene 1. Right-click Window in the Dialogue Navigator, and select Test Here. 2. Advance past Alice's first Line: the birdsong fades down over 2 seconds. 3. Advance past "On second thought, I miss them.": the birdsong fades back up. If the Test Fails • No sound is played: check that Birds.ogg is in the Ambient folder, that the Godot Editor imported it, and that the Media_Play command comes before Alice's first Line. • The volume doesn't change: check that the player of each Media_Volume command is named Ambient. • The volume changes at once: check the Time field of the Media_Volume command. The birdsong now follows the room: a Dialogue can bring any sound forward or push it into the background.