feat(packages): ludic.audio - world sounds with a gain, a pan and a pitch from where they are relative to a listener port, flat interface sounds, clips loaded past Audio.load's blind spot for packed assets, loops and the master volume; the one door to Audio.*
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
47ba3d9028
commit
fdf9866e88
10 changed files with 338 additions and 0 deletions
14
packages/ludic.audio/ports.ludic
Normal file
14
packages/ludic.audio/ports.ludic
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# ports.ludic - what the sounds ask the game: where the listener is and which way it faces, and a
|
||||
# writable directory to lift packed clips into
|
||||
export port AudioListener {
|
||||
x: fn() -> float
|
||||
z: fn() -> float
|
||||
yaw: fn() -> float = fn audio__no_yaw # radians, 0 looking down -z (render3d's cam_yaw)
|
||||
}
|
||||
|
||||
export port AudioFiles {
|
||||
cache_dir: fn() -> string = fn audio__no_cache # "" is none: a packed clip then stays silent
|
||||
}
|
||||
|
||||
function audio__no_yaw() -> float { return 0.0 }
|
||||
function audio__no_cache() -> string { return "" }
|
||||
Loading…
Add table
Add a link
Reference in a new issue