sound

Summit sound library.

Functions

Name Summary
silence

Create a playable silence sound.

tone

Create a playable tone sound.

Tables

Name Summary
SilenceSound

A playable Silence object that can be passed to channel.play or channel.gather.

ToneSound

A playable Tone object that can be passed to channel.play or channel.gather.

Tables : sound

SilenceSound

A playable Silence object that can be passed to channel.play or channel.gather.

This is the result of calling sound.silence, and can be passed as-is to channel commands which take audio files or links as input

Fields
Name Type Summary
duration

integer

The duration of the silence in milliseconds.

comfort_sound

integer

The comfort noise to play. Usually either 0 or 1400

ToneSound

A playable Tone object that can be passed to channel.play or channel.gather.

This is the result of calling sound.tone, and can be passed as-is to channel commands which take audio files or links as input.

Fields
Name Type Summary
on_duration

integer

How long the tone will play, in millseconds

off_duration

integer

How long silence will play after the tone, in milliseconds

freqs

integer

A list of frequencies which will be played

loops

integer

The number of times this tone will loop

Functions : sound

silence(duration, comfort_sound)

Create a playable silence sound. This creates a silence sound which can be passed to methods such as channel.play and channel.gather.

Parameters
Name Type Default Summary

duration

integer

The duration of the silence, in milliseconds

comfort_sound

integer

1400

The comfort noise to play. If this is 0, then no sound at all will be played. If you want some noise played, 1400 is the recommended value. Lower values will play louder comfort sounds (1 is the loudest).

Returns
Type Summary

SilenceSound

A playable SilenceSound

tone(on_duration, off_duration, frequencies, loops, volume)

Create a playable tone sound. This creates a playable ToneSound object that can be passed to methods such as channel.play and channel.gather, which will play a tone or tone stream.

Parameters
Name Type Default Summary

on_duration

integer

How long the tone should play, in milliseconds

off_duration

integer

How long silence should be played after the tone, in milliseconds

frequencies

integer or integer

a frequency or list of frequencies to play for the tone. Must be either an integer or list of integers. All frequencies specified are additive.

loops

integer or nil

1

The number of times to play the tone stream. Must be either a positive integer (not 0) or -1. If -1, this will play forever.

volume

integer or nil

nil

Volume in dB where 0 = maximum volume and negative integers represent a quieter volume. Do not enter positive values greater than zero. Not setting this value will result in the default volume being used.

Returns
Type Summary

ToneSound

A playabe ToneSound.