22 lines
No EOL
4 KiB
HTML
22 lines
No EOL
4 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Audio — Ludic</title>
|
||
<meta name="description" content="Sound effects and music.">
|
||
<link rel="stylesheet" href="base.css">
|
||
<link rel="stylesheet" href="docs.css">
|
||
</head>
|
||
<body>
|
||
<header class="nav"><div class="wrap nav-in"><a class="brand" href="index.html"><span class="logo">L</span> Ludic</a><button class="nav-toggle" aria-label="Toggle menu" aria-expanded="false">☰</button><nav class="nav-links"><a href="index.html">Home</a><a href="api.html">API Reference</a><a class="nav-cta" href="https://git.workshopsoft.io/workshopsoft/ludic">Source ↗</a></nav></div></header>
|
||
<main class="wrap item">
|
||
<div class="crumbs"><a href="api.html">API Reference</a> <span>›</span> <span class="here">Audio</span></div>
|
||
<div class="item-head"><span class="kind-badge kind-namespace">namespace</span><h1 id="top">Audio</h1></div>
|
||
<p class="ns-blurb">Sound effects and music. A sound is loaded once with <a href="audio-load.html"><code>Audio.load</code></a> into a handle; <a href="audio-play.html"><code>Audio.play</code></a> fires it one-shot and <a href="audio-play_music.html"><code>Audio.play_music</code></a> loops it on a single music channel. Playback is <strong>out-of-band</strong> — the audio device is real-time, not part of the deterministic simulation — but every trigger here is an ordinary frame-driven call, so a recorded run replays the same sounds at the same frames. Headless builds carry the whole API as no-ops (no audio device needed), so the same game code runs under the test harness.</p>
|
||
<div class="ns-methods"><a class="ns-method" href="audio-load.html"><code class="nm-sig">Audio.load(path) -> int</code><span class="nm-tip">Load a sound file into a handle.</span></a><a class="ns-method" href="audio-play.html"><code class="nm-sig">Audio.play(id) -> void</code><span class="nm-tip">Fire a one-shot sound.</span></a><a class="ns-method" href="audio-play_at.html"><code class="nm-sig">Audio.play_at(id, gain, pitch, pan) -> void</code><span class="nm-tip">Fire a one-shot with its own gain, pitch and stereo position.</span></a><a class="ns-method" href="audio-play_sound.html"><code class="nm-sig">Audio.play_sound(id) -> void</code><span class="nm-tip">Fire a one-shot sound (alias of play).</span></a><a class="ns-method" href="audio-play_music.html"><code class="nm-sig">Audio.play_music(id) -> void</code><span class="nm-tip">Loop a sound as background music.</span></a><a class="ns-method" href="audio-stop.html"><code class="nm-sig">Audio.stop(id) -> void</code><span class="nm-tip">Stop one sound.</span></a><a class="ns-method" href="audio-stop_music.html"><code class="nm-sig">Audio.stop_music() -> void</code><span class="nm-tip">Stop the music channel.</span></a><a class="ns-method" href="audio-stop_all.html"><code class="nm-sig">Audio.stop_all() -> void</code><span class="nm-tip">Stop every sound.</span></a><a class="ns-method" href="audio-volume.html"><code class="nm-sig">Audio.volume(v) -> void</code><span class="nm-tip">Set the master volume.</span></a><a class="ns-method" href="audio-pitch.html"><code class="nm-sig">Audio.pitch(v) -> void</code><span class="nm-tip">Set the playback rate / pitch.</span></a><a class="ns-method" href="audio-is_playing.html"><code class="nm-sig">Audio.is_playing(id) -> bool</code><span class="nm-tip">Is this sound playing?</span></a><a class="ns-method" href="audio-define.html"><code class="nm-sig">Audio.define(name: s, path: p) -> int</code><span class="nm-tip">Load a sound into the bank under a name.</span></a><a class="ns-method" href="audio-named.html"><code class="nm-sig">Audio.named(name: s) -> int</code><span class="nm-tip">The handle registered under a name, or 0.</span></a></div>
|
||
<a class="back" href="api.html">← All symbols</a>
|
||
</main>
|
||
<script src="ludic-highlight.js"></script>
|
||
<script>Ludic.installCards(); Ludic.flashTarget();</script>
|
||
</body></html> |