docs: regenerate site from f094acfdb5
This commit is contained in:
commit
63c5ed9baf
975 changed files with 55427 additions and 0 deletions
46
audio-play_at.html
Normal file
46
audio-play_at.html
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Audio.play_at — Ludic</title>
|
||||
<meta name="description" content="Fire a one-shot with its own gain, pitch and stereo position.">
|
||||
<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> <a href="ns-audio.html">Audio</a> <span>›</span> <span class="here">Audio.play_at</span></div>
|
||||
<div class="item-head">
|
||||
<span class="kind-badge kind-method">method</span>
|
||||
<h1 id="top">Audio.play_at</h1>
|
||||
</div>
|
||||
<code class="sig">Audio.play_at(id, gain, pitch, pan) -> void</code>
|
||||
<div class="desc"><p>Plays the sound <code>id</code> from the start as a one-shot, with its **own** gain, pitch
|
||||
and stereo position, leaving the master settings alone.</p><p><code>Audio.volume</code> and <code>Audio.pitch</code> are global: they exist so a player
|
||||
can turn the game down, and a game that used them to place a sound in the world would be
|
||||
fighting its own options screen. This is the per-voice version, and it is what distance
|
||||
attenuation is made of — work out how far away a sound is and which side it is on, and say
|
||||
so here.</p><p>- <code>gain</code> — 0.0 to 1.0, multiplied by the master volume, so the options screen
|
||||
still wins.
|
||||
- <code>pitch</code> — 1.0 is as recorded; 0.5 an octave down, 2.0 an octave up. Clamped
|
||||
to the backend's 0.25 .. 4.0.
|
||||
- <code>pan</code> — -1.0 hard left, 0.0 centred, 1.0 hard right.</p><p>One honest limitation, and it is the backend's: a loaded sound is one player, so firing
|
||||
the same handle again restarts it rather than layering a second copy over the first. Load
|
||||
a handle per variant when several need to overlap — which is what a game does anyway, to
|
||||
stop a repeated sound machine-gunning.</p></div>
|
||||
|
||||
<div class="examples"><h2>Example</h2><pre data-lang="ludic">program Demo {
|
||||
entry {
|
||||
let call = Audio.load("elk.wav")
|
||||
# an elk eighty metres off, over your left shoulder
|
||||
Audio.play_at(id: call, gain: 0.3, pitch: 0.96, pan: -0.55)
|
||||
}
|
||||
}</pre></div>
|
||||
|
||||
<a class="back" href="api.html">← All symbols</a>
|
||||
</main>
|
||||
<script src="ludic-highlight.js"></script>
|
||||
<script>Ludic.highlightAll(); Ludic.installCards(); Ludic.flashTarget();</script>
|
||||
</body></html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue