Files
godot-demo-projects/audio/generator
Hugo Locurcio b4eff8de9d Update all demos for Godot 4.6, fix Global Illumination demo
- Rebake lightmaps in Global Illumination demo with supersampling
  to improve quality.
- Increase SDFGI quality in the Global Illumination demo
  (slightly more demanding, but better matches the quality standards
  of 2026).

All demos had Project > Tools > Upgrade Project Files ran on them
with 4.6.stable (4.6.stable.mono for demos in the `mono/` folder).
2026-02-10 23:56:35 +01:00
..

Audio Generator

This is a demo showing how one can generate and play audio samples from GDScript. It plays a simple 440 Hz sine wave at 22050 Hz.

Language: GDScript

Renderer: Compatibility

Check out this demo on the asset library: https://godotengine.org/asset-library/asset/2759

How does it work?

It uses the push_frame() method on an AudioStreamGeneratorPlayback object, which is inside of an AudioStreamPlayer node, to generate audio frame-by-frame based on pulse_hz.