Skip to main content

⚙️ Customisation

You can personalise and configure your stream streaker by editing the config.js file, included in the package. Each configuration item is detailed below.

Direction of travel

The direction the animation will play.

Valid options for travel direction:

  • "ltr" to play the animation travelling from left to right
  • "rtl" to play the animation travelling from right to left

Default value: "rtl"

Volume

Defines the maximum volume level for sound effects.

The volume of each streaks sound effect will be adjusted between 50% to 100% of the maximum volume level, based on the size of the stream streak (starting at 50% for the minimum stream streak count of 3, and maxing out at 100% for streaks of 150 streams or more).

Valid options for volume: any number between 0 and 100.

Default value: 100.

Sounds

A collection of sounds that can play for a stream streak, and the rules of what is required for a sound effect to play. Each rule can contain a string to a single sound file, or a collection of different soundfiles that may be chosen at random.

// A single sound, played when no other rule matches.
"*": "./sounds/streak.mp3"
// A collection of sounds, played when no other rule matches.
// The specific sound which will be chosen from at random, each time the streak occurs.
"*": ["./sounds/streak.mp3", "./sounds/different-streak.mp3"]

In addition to fallback rules, there are a few different conditions you can configure. These include:

Fixed streak counts

Plays sounds only on set streak counts. Useful if you want a special event for certain numbers, such as someones 100th consecutive stream.

100: "./sounds/hooray.mp3",

Streak count intervals

Plays a sound on defined intervals. For example, if you want every hundredth sound to be a special effect, and every fiftieth to be a different special event, you could do so like this:

// Plays every *interval* of 100 (100, 200, 300, etc.)
"interval(100)": "./sounds/yippee.mp3",

// Plays every interval of 50.
"interval(50)": "./sounds/celebration.mp3",

Chatter-specific sound effects

You can also use the %u key to match the username of the streak user.

// Plays a sound based on the username of the streaker. For example, "PatchDoes" sharing a
// stream streak would try and play "./sounds/patchdoes.mp3", if the file exists.
"%u": "./sounds/%u.mp3",
warning

Rules are processed in the order that they're defined, and will stop checking after the first rule that matches.

This means that if you want sounds on specific numbers, they should be defined prior to intervals, which should be defined prior to the fallback sounds, etc.

This also means that if you want chatter-specific sounds, the rule should be placed at the top if you want them to play regardless of other streak-count rules, or below any numeric/interval rules if you want special streak count sounds to be prioritised instead.

Default config

The example configuration, as provided by default with the package.

config.js
const CONFIG = {
// The direction the animation will play.
// Options:
// > "ltr" - Left to right
// > "rtl" - Right to left
direction: "rtl",

// Scales the global volume of the sounds when playing (0 - 100).
volume: 100,

sounds: {
// Plays every *interval* of 100 (100, 200, 300, etc.)
"interval(100)": "./sounds/HONKHONK.mp3",

// Plays every interval of 50.
// Note that in this order, intervals of 100 will be captured first,
// so this will only play on 50's (50, 150, 250, etc).
"interval(50)": "./sounds/beepbeep.mp3",

// Plays a sound based on the username of the streaker. ("PatchDoes" streaking
// would try and play "sounds/patchdoes.mp3", if the file exists.)
"%u": "./sounds/%u.mp3",

// If nothing else matches, and if there is no "<username>.mp3" file,
// then play one of the sounds from the collection at random.
"*": ["./sounds/beepbeep.mp3", "./sounds/nyoom.mp3"],
},
};