Skip to content

Simple adaptive audio plugin for Godot 4

License

MIT, MIT licenses found

Licenses found

MIT
license.txt
MIT
godot_license.txt
Notifications You must be signed in to change notification settings

moisesjpelaez/godot-4-adaptive-audio

Repository files navigation

Godot 4 Adaptive Audio

Simple adaptive audio plugin for Godot 4.

Installation

  1. Download and extract the 'adaptive-audio' folder under the 'addons' directory.

General overview

Godot_v4 2 1-stable_win64_3Up9HG1HQC

  1. Switches the main tab to the Adaptive Audio view.
  2. Stops playing the current track.
  3. Adds a new track.
  4. Saves the current audio setup as an autoload.
  5. Loads a saved audio setup into the view.

Creating an audio setup

Press 'Add Track':

Godot_v4 2 1-stable_win64_1lCAePw750

Godot_v4 2 1-stable_win64_uDS0nehvw2

  1. Set the track's name
  2. Assign the transition fade time (preview only)
  3. Drop the audio file in ogg, mp3 or wav format
  4. Optionally select the audio file using the file viewer
  5. Plays the track
  6. Removes the track and all it's layers from the view

Press 'Add Layer' from the bottom:

Godot_v4 2 1-stable_win64_dHCmdmHKwd

  1. Transitions to a single layer. If it's in the same track, the base track keeps playing and the previous layer fades out. If it's pressed from a different track, the current track stops and the next track is player with the current layer.
  2. Blends in the layer. If it's in the same track, the current layer adds up. Same behavior as 'Transition' if it's pressed from a different track.
  3. Removes the current layer.

Add as many tracks and layers as you like:

Also assign audio files, set fade times and test trantitions; play around...

Godot_v4 2 1-stable_win64_o2Ff8TY1hI

Save the current setup:

Godot_v4 2 1-stable_win64_jsbSbdQkWM

Godot_v4 2 1-stable_win64_Xnk6ccMADr Godot_v4 2 1-stable_win64_22kC4XAct7

It creates an AdaptiveAudio.tscn file and automatically adds it as an autoload in the current project.

If you close and reopen Godot you can load your saved saved setup:

image

Playing tracks with code

Use the AdaptiveAudio autoload singleton to call the methods from anywhere in your project.

The script has multiple methods but only the following ones are intended to be used:

  • play_track: plays the BaseTrack. It can start playing using a single layer.
  • transition_to: transitions to a specific track.
  • blend_layer: blends a layer to a specific track.
  • stop_track: stops playing the current track and all its layers.

The rest of the methods are intended for the plugin's internal use.

About

Simple adaptive audio plugin for Godot 4

Resources

License

MIT, MIT licenses found

Licenses found

MIT
license.txt
MIT
godot_license.txt

Stars

Watchers

Forks

Packages

No packages published