Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

Reference · Sound controls

soundTimesfunction

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.

Import it

import { soundTimes } from "@johnmorrisdotca/toranpu/card-sounds";

Definition

function soundTimes(count: number, gap?: number): number[]

Parameters

NameTypeDescription
countnumber

The requested number of cards, sounds or layout positions.

gap (optional)number

Milliseconds between successive sounds.

Returns

number[]

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.

Examples

import { soundTimes } from "@johnmorrisdotca/toranpu/card-sounds";

console.log(soundTimes(5, 80));
[ 0, 80, 160, 240, 320 ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/toranpu 2.15.0.