A simple solution to generate events while playing a sound resource.
Ever wanted to recreate the silly koopa dance that is timed with the music (BAH BAH)?
With this solution that is possible!
AudioEvents is available from the offical asset library!
- Open Godot
- Navigate to
AssetLib
on the top - Search for
AudioEvents
- Download!
Alternatively, clone the repository and copy the addons/AudioEvents
to your own addons/
directory in the project.
Do not forget to enable the plugin in the Project settings!
- Create an
AudioEventPlayer
- Attach an
AudioStreamPlayer
. (alternatively, add theAudioEventPlayer
as child to theAudioStreamPlayer
) - Create an
AudioEventStream
resource under theAudioStreamPlayer
. - Give the
AudioEventStream
resource an audio file as resource and (optionally) a name. - Fill the
Event Times
array with float numbers that indicate the time at which an event needs to be fired.
TIP: use the Audio preview feature on the audio source to have an idea of the timings. - Connect to the
soundEvent
signal from theAudioEventPlayer
Open example.tscn
for a simple example.
If anything is not working, please open an issue via the issue tracker on GitHub.
Feel free to create a pull request with suggestions/bug fixes!
This project is MIT licensed, you can do whatever you want with it :)