本文へ移動

Jarajaraジャラジャラ

麻雀牌を描き、手牌や積み重ねた盤を配置し、シード付きの「合わせ」をひとりでも対戦卓でも遊べます。

「ジャラジャラ」は麻雀牌が触れ合う音を表す言葉です。 名前について(英語)

目次

リファレンス

音の操作

import { … } from "@johnmorrisdotca/jarajara/tile-sounds";

最小化と gzip 圧縮をしたサイズは 26.7 kB(読み込むものをすべて含み、esbuild で計測)

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The sounds of a mahjong table: a tile picked up, set down or turned over, a pair knocked together, the tiles shuffled, a clatter for a win. Off unless a table asks: nothing plays and nothing is fetched until play.

import { createTileSounds } from "@johnmorrisdotca/jarajara/tile-sounds";

const sounds = createTileSounds();
sounds.play("shuffle");
sounds.play("place", { count: 13, delay: 900 });

The recordings themselves are @johnmorrisdotca/jarajara/sounds, loaded by the first sound played. Kenney's Casino Audio, CC0: see CREDITS.md.

エクスポート

名前種類概要
createTileSounds関数A table's tile sounds.
MOST_SOUNDS_AT_ONCE定数As many sounds as one call plays: thirteen tiles set down 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 (deal-2), as base64 AAC.
TileSoundKind型One kind of sound: pick a tile lifted, place one set down, flip one turned over, pair two knocked together, shuffle the tiles washed, win a clatter of tiles.
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.

ソースを見るGitHub で編集@johnmorrisdotca/jarajara 1.7.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。