Small World Engine API Reference - v0.76.20
    Preparing search index...

    Class SynthSFX

    Procedurally synthesized sound effects built directly from Web Audio oscillator/noise graphs (no sample files needed). Kept separate from AudioSystem itself, which owns the actual mixer graph and sample playback -- this class only ever reads from the nodes it's given, it doesn't manage them.

    Index
    • Parameters

      • _context: AudioContext
      • _sfxGain: GainNode
      • _musicGain: GainNode
      • _reverbNode: ConvolverNode
      • _resume: () => void

      Returns SynthSFX

    • Generates a retro synthesized footstep thud.

      Returns void

    • Generates a retro "Pew Pew" laser/gunshot sound.

      Returns void

    • Generates a procedural synth tone (e.g., for musical instruments or physical impacts).

      Parameters

      • frequency: number = 440

        The base frequency in Hz.

      • duration: number = 0.5

        The duration of the tone in seconds.

      • volume: number = 0.5

        The starting volume.

      • type: OscillatorType = "sine"

        The oscillator type.

      Returns void

    • Starts a creepy, pulsing low-frequency background drone using the Web Audio API.

      Returns void

    • Starts a procedural fire crackling noise at a specific 3D location.

      Parameters

      • position: Vector3D
      • volume: number = 1.0

      Returns void