Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents an audio clip optimized for regular, repeated playback.

Hierarchy

  • Sample

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Sample(fileName: string): Sample
  • Construct a new sample from the contents of an audio file. The sample can be used immediately; playback will be silent until the file is fully loaded.

    Parameters

    • fileName: string

      SphereFS path of an audio file.

    Returns Sample

Properties

fileName

fileName: string

Full, canonical SphereFS path of the audio file used for this sample.

Methods

play

  • Play a new instance of this sample on a given mixer.

    Parameters

    • mixer: Mixer

      The mixer used to play back the sample.

    • Optional options: SoundOptions

      Playback options.

    Returns void

stopAll

  • stopAll(): void
  • Stop playback of all currently playing instances of this sample.

    Returns void

Static fromFile

  • fromFile(fileName: string): Promise<Sample>
  • Load an audio file in the background and construct a new sample from its contents.

    async

    Parameters

    • fileName: string

      SphereFS path of an audio file.

    Returns Promise<Sample>

    A promise for the newly constructed Sample.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc