Video Game Design and Coding · PLECK lesson

PLECK lesson 97 · suggested week 20, day 2

Import a short original audio file

Objective. Use a local AudioStreamPlayer with an explicit play action.

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-L096.

Use a short original WAV or OGG provided by a teacher or recorded privately with permission. Put it in audio and assign it to an AudioStreamPlayer named Sound as in C-AUDIO. Turn autoplay off and lower volume before testing. Press Play to trigger the sound. Keep recordings free of conversations, names and background private information. If recording is unavailable, use a teacher-provided original sound; recording equipment is not part of the programming requirement.

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.

Import a short original audio file — evidence task

  1. 1. Build the C-AUDIO lab with a short original sound.
  2. 2. Record filename, origin and duration in the asset inventory.

Deliverable. Audio lab source and asset inventory update.

Acceptance checks

Understanding question. Why include the actual sound file in the project artifact?

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 ____________________