cacophony
    Preparing search index...

    Class PcmStreamSound

    The base interface for any sound-producing entity, including individual sounds, groups, and playbacks. BaseSound

    Hierarchy

    • RoutableSource
      • PcmStreamSound

    Implements

    Index
    _filters: BiquadFilterNode[] = []
    _position: Position
    _routeTarget: Bus | null = null

    Primary route target. null is the canonical master route.

    _sends: Map<Bus, number> = ...

    Additional send target to gain-value mappings.

    _stereoPan: number
    _threeDOptions: ThreeDOptions
    _volume: number
    context: BaseContext
    globalGainNode: GainNode
    panType: PanType
    playbacks: PcmStreamPlayback[]
    soundType?: SoundType
    spatialSmoothingTau: number

    Spatial time constant in seconds; assigning changes current and future voices.

    streamCapabilities?: StreamCapabilities
    • get stereoPan(): number

      Returns number

    • set stereoPan(value: number): void

      Parameters

      • value: number

      Returns void

    • Called by Bus.drainTo to move this source off the draining bus onto target. The source reroutes its primary route and/or any send that targeted bus.

      Parameters

      Returns void

    • Materialize all declared recipes, then establish this playback's sends.

      Parameters

      • playback: BasePlayback

      Returns void

    • Resolve the node used by future playbacks for their primary output. Sources left on a subsequently destroyed bus fall back to master.

      Returns GainNode

    • Internal

      Validate a broadcast, including every voice, without mutation.

      Parameters

      • options: SpatialOptions

      Returns void

    • Establish every configured send on a newly created playback.

      Parameters

      • playback: BasePlayback

      Returns void

    • Parameters

      • value: number
      • duration: number
      • Optionaltype: FadeType

      Returns Promise<void>

    • Parameters

      • error: unknown

      Returns void

    • Remove this source's aux send from current and future playbacks without changing its primary route. No-op if no send exists, including when the bus reference is destroyed. Names must still resolve to a registered bus; retain the bus reference to remove a send after destroying a named bus.

      Parameters

      • target: string | Bus

      Returns void

    • Route this source to a bus, or add an independent send when sendGain is provided. options ramps existing sends in place; new sends and future playbacks start at sendGain. Prior automation is canceled and re-anchored. Exponential ramps to zero approach 0.0001, then become exactly silent at the endpoint. Ramps from zero or involving negative gains use linear interpolation.

      Parameters

      Returns void

      RangeError for non-finite gain or negative/non-finite duration.

      TypeError when options is given without sendGain; primary routes do not ramp.

    • Enqueue PCM at the context's sample rate.

      Samples are interleaved according to channelCount. false means the fixed ring buffer is full (or this accepted write filled it); wait for drain before retrying a rejected chunk.

      Parameters

      • samples: Float32Array

      Returns boolean