Constructor
# new Music(zzfxMusic)
Create a music object and cache the zzfx music samples for later use
Parameters:
Name | Type | Description |
---|---|---|
zzfxMusic |
Array | Array of zzfx music parameters |
- Source:
Methods
# play(volumeopt, loopopt) → {AudioBufferSourceNode}
Play the music
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
volume |
Number |
<optional> |
1 | How much to scale volume by |
loop |
Boolean |
<optional> |
1 | True if the music should loop when it reaches the end |
- Source:
Returns:
- The audio node, can be used to stop sound later
- Type
- AudioBufferSourceNode