FAudioGMS-Docs/docs/latest/Functions-(Essentials).md

37 lines
1.6 KiB
Markdown
Raw Normal View History

2021-11-02 22:41:02 +00:00
# Essential Functions
2021-11-02 21:49:53 +00:00
## `~_Init(spatialDistanceScale, timestep)`
2021-11-02 20:39:21 +00:00
**Returns:** N/A (`undefined`)
2022-01-26 19:20:47 +00:00
|Argument |Datatype|Description |
|----------------------|--------|---------------------------------------------------------------------------------------------------------------|
|`spatialDistanceScale`|number |3D Volume scaling factor. Higher numbers make sounds that are further away quieter. A recommended value is `50`|
2022-01-26 19:20:47 +00:00
|`timestep` |number |Number of seconds expected to pass for each call to `FAudio_Update()`. This is usually `1/fps` |
2021-11-02 20:39:21 +00:00
2021-11-02 22:36:01 +00:00
!> `FAudioGMS_Init()` must be called once at the very start of your game. If in doubt, place the `AUDIO` object in the first room in your game.
2021-11-02 20:39:21 +00:00
 
2021-11-02 21:49:53 +00:00
## `~_Update()`
2021-11-02 20:39:21 +00:00
**Returns:** N/A (`undefined`)
|Argument|Datatype|Description|
|--------|--------|-----------|
|None | | |
2021-11-02 22:36:01 +00:00
!> `FAudioGMS_Update()` must be called once every frame, usually in the Step event of a persistent instance. Ensure that this instance doesn't get deactivated if you're using instance deactivation for e.g. a pause screen. If in doubt, place the `AUDIO` object in the first room in your game.
2021-11-02 20:39:21 +00:00
 
2021-11-02 21:49:53 +00:00
## `~_Destroy()`
2021-11-02 20:39:21 +00:00
**Returns:** N/A (`undefined`)
|Argument|Datatype|Description|
|--------|--------|-----------|
2021-11-02 23:42:12 +00:00
|None | | |
This will automatically free all memory allocated by FAudioGMS. All FAudioGMS-related IDs are invalid after this function is called. Calling any FAudioGMS function after `FAudioGMS_Destroy()` is called will do nothing.