Class: PlayerEngine

PlayerEngine

Used with a buffer to serve audio files.

example

Constructor

new PlayerEngine(optionsopt)

Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Default options

Properties
Name Type Attributes Default Description
buffer Number <optional>
1

Audio buffer

fadeTime Number <optional>
0.005

Fade time for chaining segments

cyclic Number <optional>
false

Loop mode

gain Number <optional>
1

Gain

Source:
Example
import * as audio from 'waves-audio';
const playerEngine = audio.PlayerEngine();
const playControl = new audio.PlayControl(playerEngine);

playControl.start();

Extends

Members

buffer :AudioBuffer

Audio buffer

Type:
  • AudioBuffer
Default Value:
  • null
Source:

(readonly) bufferDuration :Number

Get buffer duration

Type:
  • Number
Source:

cyclic :Bool

Set whether the audio buffer is considered as cyclic

Type:
  • Bool
Source:

fadeTime :Number

Fade time for chaining segments (e.g. in start, stop, and seek)

Type:
  • Number
Default Value:
  • 0.005
Source:

gain :Number

Linear gain factor

Type:
  • Number
Source:

Methods

connect(target)

Connect to an audio node (e.g. audioContext.destination)

Parameters:
Name Type Description
target AudioNode

Target audio node

Inherited From:
Source:

disconnect(target)

Disconnect from an audio node (e.g. audioContext.destination). If undefined disconnect from all target nodes.

Parameters:
Name Type Description
target AudioNode

Target audio node.

Inherited From:
Source: