This commit is contained in:
2026-05-06 17:52:45 -07:00
parent 9fc3f35125
commit 1463c23334
402 changed files with 3758 additions and 0 deletions

BIN
sound/Bundled/hit0.wav Normal file

Binary file not shown.

BIN
sound/Bundled/hit1.wav Normal file

Binary file not shown.

BIN
sound/Bundled/hit2.wav Normal file

Binary file not shown.

6
sound/README.md Normal file
View File

@ -0,0 +1,6 @@
- Keyboard `Space`: load/play bundled sound
- Keyboard `A`: toggle play/pause positional speaker
- https://github.com/leenkx3d/leenkx/wiki/sound
- https://api.leenkx3d.org/iron/object/SpeakerObject.html
- https://api.leenkx3d.org/kha/Sound.html

View File

@ -0,0 +1,32 @@
package lnx;
import iron.object.SpeakerObject;
import iron.system.Input;
class SoundControl extends iron.Trait {
public function new() {
super();
notifyOnInit(() -> {
final mouse = Input.getMouse();
final keyboard = Input.getKeyboard();
final speaker = iron.Scene.active.getSpeaker('Speaker');
trace(speaker.data);
notifyOnUpdate( () -> {
if(keyboard.started('a')) {
trace('Toggle speaker (${!speaker.paused})');
speaker.paused ? speaker.play() : speaker.pause();
}
if(keyboard.started('space')) {
// Randomly play one of the three hit sounds
final sound = 'hit${Std.random(3)}.wav';
trace('Play $sound');
iron.data.Data.getSound(sound, (s:kha.Sound) -> {
var channel = iron.system.Audio.play(s);
channel.volume = 0.4;
});
}
});
});
}
}

BIN
sound/drums.wav Normal file

Binary file not shown.

BIN
sound/sound.blend Normal file

Binary file not shown.