DHAudio
DHAudio class
Constructor Summary
Public Constructor | ||
public |
constructor |
Method Summary
Public Methods | ||
public |
check if it can play MP3 file |
|
public |
check if it can play OGG file |
|
public |
canPlayType(type: string): boolean check if browser can play the given type of sound file |
|
public |
pause sound |
|
public |
play sound |
|
public |
play sound |
|
public |
playDistanceDirection(distance: float, direction: float): float play sound from given distance and direction |
|
public |
setListener(listener: Camera): boolean set listener object |
|
public |
set sound file to play |
|
public |
setSoundSource(sndSrc: DH3DObject): boolean set sound source |
Public Constructors
Public Methods
public canPlayType(type: string): boolean source
check if browser can play the given type of sound file
Params:
Name | Type | Attribute | Description |
type | string | String of type |
public playDistanceDirection(distance: float, direction: float): float source
play sound from given distance and direction
Params:
Name | Type | Attribute | Description |
distance | float | distance from sound source |
|
direction | float | 0: left, 1: right |
Return:
float | true: success, false: failure |
public setListener(listener: Camera): boolean source
set listener object
Params:
Name | Type | Attribute | Description |
listener | Camera | listener object |
public setSound(leftSnd: HTMLAudioElement, rightSnd: HTMLAudioElement): boolean source
set sound file to play
Params:
Name | Type | Attribute | Description |
leftSnd | HTMLAudioElement | Sound file for left side |
|
rightSnd | HTMLAudioElement | Sound file for right side |
public setSoundSource(sndSrc: DH3DObject): boolean source
set sound source
Params:
Name | Type | Attribute | Description |
sndSrc | DH3DObject | sound source |