forked from MoonsideGames/FAudioGMS
4 changed files with 55 additions and 5 deletions
@ -1 +1,17 @@
|
||||
/// @description Clean up all resources when the game is about to end. |
||||
|
||||
/* Destroy sound instances first: */ |
||||
// sndInst.Stop(); |
||||
// sndInst.Destroy(); |
||||
// sndInst = undefined; |
||||
|
||||
/* Only then destroy static sounds: */ |
||||
// snd.Destroy(); |
||||
// snd = undefined; |
||||
|
||||
/* And only then, destroy effect chains */ |
||||
effChain.Destroy(); |
||||
effChain = undefined; |
||||
|
||||
/* Finish up the system */ |
||||
FAudioGMS_Destroy(); |
||||
|
@ -1,6 +1,15 @@
|
||||
/// @description Initialize audio. |
||||
|
||||
/* First initialize the system: */ |
||||
var spatialDistanceScale = 50; // makes "3D" audio louder |
||||
FAudioGMS_Init(spatialDistanceScale, 1 / 60); |
||||
var timestep = game_get_speed(gamespeed_microseconds) / 1000000; // default, autodetect from GM timestep. |
||||
FAudioGMS_Init(spatialDistanceScale, timestep); |
||||
|
||||
/* Init Effects Chains Here */ |
||||
effChain = new EffectChain(); |
||||
effChain.AddDefaultReverb(); |
||||
|
||||
/* Load Audio Assets Here */ |
||||
// snd = LoadStaticSound("go-go-go-tigerblood.wav"); |
||||
// sndInst = snd.Play(); |
||||
// sndInst.SetEffectChain(effChain, 1); // apply default reverb to the instance. |
||||
|
@ -1 +1,2 @@
|
||||
FAudioGMS_Update(); |
||||
/// @description MUST be called once per frame! |
||||
FAudioGMS_Update(); |
||||
|
Loading…
Reference in new issue