Options
All
  • Public
  • Public/Protected
  • All
Menu

Provides a stream-like interface for playing raw audio data.

Hierarchy

  • SoundStream

Index

Constructors

Properties

Methods

Constructors

constructor

  • new SoundStream(sampleRate?: number, bitsPerSample?: 8 | 16 | 32, numChannels?: number): SoundStream
  • Construct a new audio stream with the given parameters.

    Parameters

    • Optional sampleRate: number

      The sample rate of the audio data, in Hz.

    • Optional bitsPerSample: 8 | 16 | 32

      The number of bits per sample.

    • Optional numChannels: number

      Number of independent audio channels in the audio data.

    Returns SoundStream

Properties

length

length: number

Methods

pause

  • pause(): void

play

  • play(mixer?: Mixer): void
  • Play this audio stream on a given mixer. If the stream is paused and a mixer is not specified, resume playback from the paused position.

    Parameters

    Returns void

stop

  • stop(): void
  • Stop playback and discard any unplayed data in the stream buffer.

    Returns void

write

  • write(data: ArrayBuffer | ArrayBufferView): void
  • Write new audio data to the end of the stream buffer. Can (and should!) be called during active playback.

    Parameters

    • data: ArrayBuffer | ArrayBufferView

      Buffer containing audio data to feed into the stream.

    Returns void

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