🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Godot Teases New Audio Features for 3.2

Started by
0 comments, last by khawk 5 years, 2 months ago

Godot is planning to add a few new audio features to its upcoming 3.2 release.

Generate Audio

The AudioStreamGenerator is a new type of AudioStream that can be put in the regular stream players. Its purpose is to allow developers to programmatically generate and push stereo audio frames via buffers. For example:


func _fill_buffer():
        var increment = (1.0 / (hz / pulse_hz)) 

        var to_fill = playback.get_frames_available()
        while (to_fill > 0):
                playback.push_frame( Vector2(1.0,1.0) * sin(phase * (PI * 2.0)) 
                phase = fmod((phase + increment), 1.0)
                to_fill-=1;

Spectrum Analyzer

A new spectrum analyzer effect is also being added. This allows you to retrieve frequency range magnitudes, which can then be used for visualization or other purposes. Here's a short video demonstrating the effect:

 

View the sample code for these features in the Godot demo repository.


View full story

Admin for GameDev.net.

This topic is closed to new replies.

Advertisement