-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
377 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Using FMOD plugin | ||
|
||
This documentation provides detailed guidance on how to use the FMOD GDExtension plugin for integrating FMOD into your | ||
Godot projects. | ||
|
||
The plugin offers two main approaches for interacting with FMOD: | ||
1. **Using FMOD Nodes**: Predefined nodes that simplify common FMOD tasks. | ||
2. **Using the `FmodServer` API**: A singleton that gives you direct access to FMOD's core and system APIs for more | ||
advanced or customized workflows. | ||
|
||
#### Core Component: `FmodServer` | ||
At the heart of the plugin is the `FmodServer` singleton. It serves as a bridge to FMOD's powerful API, allowing you to | ||
control audio behavior programmatically. FMOD nodes are built on top of this singleton, offering higher-level | ||
abstractions for convenience. | ||
|
||
## Summary | ||
- Loading banks | ||
- [Using node](4-loading-banks.md#fmodbankloader-node) | ||
- [Using FmodServer](4-loading-banks.md#fmodserver-api) | ||
- Playing events | ||
- [Using node](5-playing-events.md#fmodeventemitter-nodes) | ||
- [Using FmodServer](5-playing-events.md#fmodserver-api) | ||
- Listeners | ||
- [Using node](6-listeners.md#fmod-listener-nodes) | ||
- [Using FmodServer](6-listeners.md#using-fmodserver-api) | ||
- [Playing sounds](7-playing-sounds.md) | ||
- [Other low level examples](8-other-low-level-examples.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Loading banks | ||
|
||
In this guide we'll explore how to load banks within your game. | ||
|
||
## FmodBankLoader node | ||
|
||
`FmodBankLoader` is in charge of loading banks when entering the scene. You should place it, in the scene hierarchy, | ||
before all other fmod nodes using this bank. Banks are unloaded on exit tree. | ||
|
||
Banks are `RefCounted`, so several `FmodBankLoader` can share same banks. | ||
|
||
If you want to load your bank when starting game and keep them loaded, use this node and add it as **autoload** node. | ||
|
||
You can add banks with fmod project explorer, using the `+` button with bank icon, or manually add a bank using bottom | ||
line edit. You can also remove and re-order banks: | ||
![fmod-bank-image] | ||
|
||
!!! warning | ||
Make sure to first place `Master.strings.bank` first, and `Master.bank` in second. Those banks are dependencies needed | ||
by other banks. So if you don't load them first, you won't be able to load other banks. | ||
|
||
## FmodServer api | ||
|
||
You can also load banks using `FmodServer` api. | ||
For this purpose, you should use `load_bank` method of `FmodServer` singleton. | ||
|
||
Here is an example: | ||
```gdscript | ||
var banks := Array() | ||
func _ready(): | ||
banks.append(FmodServer.load_bank("res://Master.bank", FmodServer.FMOD_STUDIO_LOAD_BANK_NORMAL)) | ||
banks.append(FmodServer.load_bank("res://Master.strings.bank", FmodServer.FMOD_STUDIO_LOAD_BANK_NORMAL)) | ||
banks.append(FmodServer.load_bank("res://Music.bank", FmodServer.FMOD_STUDIO_LOAD_BANK_NORMAL)) | ||
``` | ||
|
||
!!! warning | ||
As banks are `RefCounted`, don't forget to store them. Otherwise reference counter will be directly decremented leading | ||
to unload of the bank. | ||
|
||
!!! warning | ||
Make sure to first load `Master.strings.bank`, and `Master.bank` in second. Those banks are dependencies needed by other | ||
banks. So if you don't load them first, you won't be able to load other banks. | ||
|
||
[fmod-bank-image]: ./assets/fmod-bank.png |
Oops, something went wrong.