tavurth / godot-sfxr

Godot plugin that adds the SfxrStreamPlayer node to generate sound effects inside the editor.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GodotSfxr

Godot plugin that adds the SfxrStreamPlayer node to generate sound effects inside the editor.

SfxrStreamPlayer Node

Ported from jsfxr (by Eric Fredricksen), which is a port from the original sfxr (by DrPetter).

Installation

  • Install from the Godot Asset Library (under review, link pending).

  • Clone or download this repository, and copy the contents of the "addons" directory to the "addons" directory of your Godot Project.

Usage

Add the node "SfxrStreamPlayer".

20220124174216

Select a preset sound effect under the "Actions" group in the inspector.

20220124174501

You can adjust the sound parameters on the inspector as needed.

Click the "Play" checkbox under the "Actions" group to hear the sound effect.

20220124174603

To trigger the sound effect, call the "play_sfx" function on the node.

20220124175030

This custom node is made using the AudioStreamGenerator resource, which is filled with the Audio data to be streamed. The first time the audio data is computed it might take some time (due to gdscript), so it is suggested you "pre-load" it before needing it with the "_build_buffer" function. This will cache the audio data and stream it instantly the next time you play it.

20220124180307

Another drawback is that because it is an AudioStreamGenerator, the player node is always "playing", as it is always waiting for audio data to be streamed, so the "finished" signal is never triggered for this node.

About

Godot plugin that adds the SfxrStreamPlayer node to generate sound effects inside the editor.

License:MIT License


Languages

Language:GDScript 100.0%