ToneConstantSource
internal class Signal ↳ extends OneShotSource<ToneConstantSourceOptions<TypeName>>
Wrapper around the native fire-and-forget ConstantSource. Adds the ability to reschedule the stop method.
Constructor
Section titled “Constructor”new ToneConstantSource(offset: UnitMap[TypeName])Parameters
-
offset
UnitMap[TypeName]The offset value
new ToneConstantSource(options?: Partial<ToneConstantSourceOptions<TypeName>>)Parameters
- options
Partial<ToneConstantSourceOptions<TypeName>>optional
Properties
Section titled “Properties”read-only
name: stringThe name of the class
Default: "ToneConstantSource"
onended
Section titled “onended”↳ inherited from OneShotSource
onended: onEndedCallbackThe callback to invoke after the source is done playing.
Default: noOp
read-only ↳ inherited from OneShotSource
state: BasicPlaybackStateGet the playback state at the current time
Methods
Section titled “Methods”cancelStop()
Section titled “cancelStop()”↳ inherited from OneShotSource
cancelStop(): thisCancel a scheduled stop event
Returns this
getStateAtTime()
Section titled “getStateAtTime()”↳ inherited from OneShotSource
getStateAtTime(time: Time): BasicPlaybackStateGet the playback state at the given time
Parameters
- time
Time
Returns BasicPlaybackState
start()
Section titled “start()”start(time?: Time): thisStart the source node at the given time
Parameters
-
time
TimeoptionalWhen to start the source
Returns this
stop()
Section titled “stop()”↳ inherited from OneShotSource
stop(time?: Time): thisStop the source node at the given time.
Parameters
-
time
TimeoptionalWhen to stop the source
Returns this
getDefaults()
Section titled “getDefaults()”static
getDefaults(): ToneConstantSourceOptions<any>Returns all of the default options belonging to the class.
Returns ToneConstantSourceOptions<any>
Inherited members
Section titled “Inherited members”- From
ToneWithContext: context, blockTime, sampleTime, get(), immediate(), now(), set(), toFrequency(), toSeconds(), toTicks() - From
Tone: debug, version, disposed, toString() - From
ToneAudioNode: channelCount, channelCountMode, channelInterpretation, numberOfInputs, numberOfOutputs, chain(), connect(), disconnect(), fan(), toDestination(), toMaster()