Skip to content
Tone.js

ToneConstantSource

internal class Signal ↳ extends OneShotSource<ToneConstantSourceOptions<TypeName>>

Wrapper around the native fire-and-forget ConstantSource. Adds the ability to reschedule the stop method.

new ToneConstantSource(offset: UnitMap[TypeName])

Parameters

  • offset UnitMap[TypeName]

    The offset value

new ToneConstantSource(options?: Partial<ToneConstantSourceOptions<TypeName>>)

Parameters

↳ inherited from OneShotSource

input: undefined

Sources do not have input nodes

read-only

name: string

The name of the class

Default: "ToneConstantSource"

read-only

offset: Param<TypeName>

The offset of the signal generator

↳ inherited from OneShotSource

The callback to invoke after the source is done playing.

Default: noOp

↳ inherited from OneShotSource

output: Gain

The public output node

read-only ↳ inherited from OneShotSource

Get the playback state at the current time

↳ inherited from OneShotSource

cancelStop(): this

Cancel a scheduled stop event

Returns this

dispose(): this

Dispose and disconnect

Returns this

↳ inherited from OneShotSource

getStateAtTime(time: Time): BasicPlaybackState

Get the playback state at the given time

Parameters

Returns BasicPlaybackState

start(time?: Time): this

Start the source node at the given time

Parameters

  • time Time optional

    When to start the source

Returns this

↳ inherited from OneShotSource

stop(time?: Time): this

Stop the source node at the given time.

Parameters

  • time Time optional

    When to stop the source

Returns this

static

getDefaults(): ToneConstantSourceOptions<any>

Returns all of the default options belonging to the class.

Returns ToneConstantSourceOptions<any>