Video Game Design and Coding · PLECK lesson

PLECK lesson 100 · suggested week 20, day 5

Test audio activation and quiet play

Objective. Explain browser restrictions and preserve a local alternative.

Godot Engine Standard desktop editor 4.7.2-stable, GDScript (Godot 4), Compatibility renderer. Headless Godot 4.7.2.stable.official.ed1daf0bf passed 106 assertions on the supplied scaffolds, including malformed JSON saves. Audio used the Dummy driver and a synthetic WAV, not a speaker. The visual editor, browser export, and signed-in submission were not tested. The desk still does not run a student's own upload.

About 55 minutes. The due date is chosen by a parent.

Original sound, safe levels, activation, mute and licensing

Suggested pace: Recall and predict 5 min; Read instruction and scaffold 12 min; Build or design the assigned artifact 25 min; Run acceptance tests 8 min; Explain and checkpoint 5 min.

Materials: Godot Standard 4.7.2 desktop editor (GDScript, Compatibility renderer), Local course folder and prior checkpoint, No paid assets or public account required.

Comes after VGC-L099.

Browsers often require a user gesture before playing audio, and a Godot web export has additional constraints. If you test a web build later, start with an explicit Start button rather than assuming autoplay. The required course path remains local editor play, which needs no hosting account. Test the game with audio off and low volume; all required actions and outcomes must remain understandable. Record the tested platform instead of claiming sound works identically everywhere.

Worked example

A short original tap sound confirms a collected object while a number changes on screen. Muting the tap leaves all required information visible. Scaffold C-AUDIO — Local audio playback with a reversible mute Setup: Create Control AudioLab with Button Play and CheckButton Mute. Child AudioStreamPlayer Sound: copy the supplied student-support/audio/course-tap.wav into your project audio folder and assign it (or another short original WAV/OGG), autoplay Off, volume_db -12. Attach script to AudioLab. Recording is optional: a teacher-provided original file is equivalent. No microphone or face recording is required and all recording stays private. ```gdscript extends Control func _ready() -> void: $Play.pressed.connect(_play) $Mute.toggled.connect(_mute) func _play() -> void: if not $Mute.button_pressed: $Sound.play() func _mute(enabled: bool) -> void: if enabled: $Sound.stop() ```

Local audio playback with a reversible mute

GDScript (Godot 4, not Scratch, Python, JavaScript or C#). Scaffold C-AUDIO. Copy starts from this text. The desk does not run it.

Scene and node setup

Create Control AudioLab with Button Play and CheckButton Mute. Child AudioStreamPlayer Sound: copy the supplied student-support/audio/course-tap.wav into your project audio folder and assign it (or another short original WAV/OGG), autoplay Off, volume_db -12. Attach script to AudioLab. Recording is optional: a teacher-provided original file is equivalent. No microphone or face recording is required and all recording stays private.

extends Control
func _ready() -> void:
    $Play.pressed.connect(_play)
    $Mute.toggled.connect(_mute)
func _play() -> void:
    if not $Mute.button_pressed:
        $Sound.play()
func _mute(enabled: bool) -> void:
    if enabled:
        $Sound.stop()

Checks to run in the editor

Native Godot 4.7.2.stable.official.ed1daf0bf headless compile and representative node-tree/runtime tests passed; see native-qa-results.json. Visual UI, audible output, exports and website submission still need separate checks.

Test audio activation and quiet play — evidence task

  1. 1. Run a complete muted local round and a low-volume round.
  2. 2. Add a Start interaction before audio if a web build is tested.

Deliverable. Audio accessibility report and updated readme.

Acceptance checks

Understanding question. Does successful desktop playback prove browser autoplay will work?

Include a downloadable project ZIP with project.godot, .tscn, .gd and original asset files when code changes. A private, teacher-accessible download link to that ZIP is equivalent. Screenshots or a playthrough do not replace editable source.

If this is still shaky. Use one short teacher-provided original sound or a privately recorded tap. Keep volume modest and retain text cues. Start with the first assigned task and re-run its acceptance test before adding the remaining feature.

Optional extra. Compare two sound choices with the same loudness and explain which better communicates the event. Document one changed parameter, your prediction, and the observed effect; optional, not required for completion.

Name ____________________ Date ____________________