Constructor
new SoundManager(optionsopt)
Creates a new sound manager.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Options options object.
Properties
|
Properties:
Name | Type | Description |
---|---|---|
volume |
Number | Global volume for the manager. All pc.SoundInstances will scale their volume with this volume. Valid between [0, 1]. |
- Source:
Methods
(private, static) hasAudio() → {Boolean}
Reports whether this device supports the HTML5 Audio tag API
- Source:
Returns:
true if HTML5 Audio tag API is supported and false otherwise
- Type
- Boolean
(private, static) hasAudioContext() → {Boolean}
Reports whether this device supports the Web Audio API
- Source:
Returns:
true if Web Audio is supported and false otherwise
- Type
- Boolean
(private) playSound(sound, options) → {pc.Channel}
Create a new pc.Channel and begin playback of the sound.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sound |
pc.Sound | The Sound object to play. | ||||||||||||
options |
Object | Optional options object.
Properties
|
- Source:
Returns:
The channel playing the sound.
- Type
- pc.Channel
(private) playSound3d(sound, position, options) → {pc.Channel3d}
Create a new pc.Channel3d and begin playback of the sound at the position specified
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sound |
pc.Sound | The Sound object to play. | ||||||||||||
position |
pc.Vec3 | The position of the sound in 3D space. | ||||||||||||
options |
Object | Optional options object.
Properties
|
- Source:
Returns:
The 3D channel playing the sound.
- Type
- pc.Channel3d