Is it possible to generate sound in UPBGE?

I wonder if this is possible - generating sound in UPBGE via python and playing it. I’m not talking about files here, but realtime procedural audio, for example, a curtain fluttering in the wind, or wind blowing intermittently.

Or am I stuck with sound files for now?

Yes,

Hold Space for Sinus-Tone
Hold T for Tetris-melody

Audaspace Tutorial:
https://audaspace.github.io/bindings/tutorials.html
Tetris code from here:
https://github.com/neXyon/audaspace/blob/master/bindings/python/examples/tetris3.py

UPBGE03_SoundGen.blend (829.8 KB)

Is Audaspace included in UPBGE, or is it a downloadable addon?

It’s included.
Somehow it’s missing in the UPBGE-documentation but here it is for Blender:
https://docs.blender.org/api/current/aud.html