Skip to the content

Jarajaraジャラジャラ

Draw mahjong tiles, arrange racks and stacked boards, and play seeded Awase alone or at a shared table.

Jarajara is the Japanese sound of mahjong tiles rattling together. About the name

Contents

Reference

Sound controls

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

26.7 kB minified and gzipped, with everything it imports (measured with 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.

Exports

NameKindWhat it is
createTileSoundsfunctionA table's tile sounds.
MOST_SOUNDS_AT_ONCEconstantAs many sounds as one call plays: thirteen tiles set down are eight clicks, not a wall of noise.
PlayTileSoundOptionstypeHow one sound is played.
soundTimesfunctionWhen 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_KINDSconstantEvery kind of sound, in the order a game meets them.
TileSoundDatatypeThe recordings, by name (deal-2), as base64 AAC.
TileSoundKindtypeOne 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.
TileSoundstypeA table's sounds: play one, mute and unmute, change the volume, close when the table goes.
TileSoundsOptionstypeHow a table's sounds are made.
TileSoundWindowtypeThe parts of a window the sounds use: an audio context and atob.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/jarajara 1.7.0.