Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geegaz/audioeventsystem
A flexible SFX plugin for Godot 4.x
https://github.com/geegaz/audioeventsystem
godot godot-addon godot-engine godot-plugin godot4
Last synced: about 2 months ago
JSON representation
A flexible SFX plugin for Godot 4.x
- Host: GitHub
- URL: https://github.com/geegaz/audioeventsystem
- Owner: geegaz
- License: mit
- Created: 2023-11-05T20:55:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-20T11:00:36.000Z (about 1 year ago)
- Last Synced: 2024-11-05T12:13:01.559Z (3 months ago)
- Topics: godot, godot-addon, godot-engine, godot-plugin, godot4
- Language: GDScript
- Homepage:
- Size: 59.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Audio Event System
A flexible SFX plugin for Godot 4.x## Introduction
The goal of this plugin is to give the most common features needed for sound effects (like randomized stream and randomized pitch) while also removing the need for multiple `AudioStreamPlayer`s to play different sounds. This plugin changes the audio workflow to bring it a bit closer to audio middlewares like [FMOD](https://fmod.com/), using `AudioEvent` resources to setup sound effects and an `AudioEventManager` to play them.
## Plugin structure
![a beautiful graph to explain the structure of the plugin, that may or may not have been made in ms-paint](/addons/audio_event_system/docs/addon_structure.png)The plugin relies on a single resource, the `AudioEvent`. This resource contains the information needed to play a single sound effect:
- a list of `AudioStream`
- a minimum and maximum pitch
- a minimum and maximum volumeThis resource is then used either directly through code by calling one of the `AudioEventManager`'s method, or by using an `AudioEventEmitter` which is a node dedicated to play an `AudioEvent` and designed as a replacement for an `AudioStreamPlayer` in the scene hierarchy.
Example of playing an `AudioEvent` directly with the `AudioEventManager`:
```
@export var event : AudioEventfunc play_event_directly() -> void:
# Play the event without spatialization
AudioEventManager.play_event(event)
```
Example of playing an `AudioEvent` through an `AudioEventEmitter`:
```
@onready var _Emitter := $AudioEventEmitterfunc play_event_emitter() -> void:
_Emitter.play()
```Like `AudioStreamPlayer`s, `AudioEventEmitter`s come in 3 types:
- `AudioEventEmitter`, a non-spatialized emitter for global events
- `AudioEventEmitter2D`, an emitter spatialized in 2D
- `AudioEventEmitter3D`, an emitter spatialized in 3D