リファレンス
音の操作
import { … } from "@johnmorrisdotca/domino/tile-sounds";
最小化と gzip 圧縮をしたサイズは 19.3 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
THE SOUNDS OF A DOMINO TABLE: tiles shuffled, a tile drawn from the boneyard, a tile laid, a knock on the table for a pass. The recordings are poker chips set down and handled (Kenney's Casino Audio, CC0; see CREDITS.md), the nearest recorded sound of a hard tile on a table that is free to use. They are loaded the first time a sound is played and never before, so a page that stays silent never fetches them. Where they cannot be loaded or decoded, a short sound made in the browser stands in. Nothing here throws: a platform with no audio, a context the browser holds still, or a failed decode is simply silent.
Domino never makes a sound by itself. A table asks for one with play.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
createTileSounds | 関数 | A table's tile sounds. |
MOST_SOUNDS_AT_ONCE | 定数 | As many sounds as one call plays: fifteen tiles drawn are eight clicks, not a wall of noise. |
PlayTileSoundOptions | 型 | How one sound is played. |
soundTimes | 関数 | When each of count sounds starts, in milliseconds from the first: one every gap, and no more than MOST_SOUNDS_AT_ONCE, spread over the same time. |
TILE_SOUND_KINDS | 定数 | Every kind of sound, in the order a game meets them. |
TileSoundData | 型 | The recordings, by name (lay-2), as base64 AAC. |
TileSoundKind | 型 | One kind of sound: shuffle the tiles stirred face down, draw a tile taken from the boneyard, lay a tile set down on a train, knock a rap on the table, which is how a pass is announced. |
TileSounds | 型 | A table's sounds: play one, mute and unmute, change the volume, close when the table goes. |
TileSoundsOptions | 型 | How a table's sounds are made. |
TileSoundWindow | 型 | The parts of a window the sounds use: an audio context and atob. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。