Generated Music

Makes a new instrumental track for your Lens and plays it. Say the mood you want, for example calm lofi for a rainy day. There are no words or singing.

AI & Generative

Describe it and watch AI generate video, props, animations, or a whole new scene.

Made with this block

Inputs

volumefloat

Volume level. Hard limits: 0-1. Recommended range: 0.3-1.0. Values below 0.1 are nearly inaudible.

loopsint

Loop count. 0 = play once. -1 = loop forever. Any positive integer = that many extra repeats. Hard limit: -1 minimum. For background music, use -1.

audioTrackmp3

The audio file to play.

Functions

playvoid

Starts playback with the configured loop count. No-op if audioTrack is not set

pausevoid

Pauses the currently playing audio.

resumevoid

Resumes playback from where it was paused.

stopvoid

Stops playback immediately (no fade)

isPlayingboolean

Returns true if audio is currently playing.

isPausedboolean

Returns true if audio is currently paused.

getPositionfloat

Returns current playback position in seconds.

getDurationfloat

Returns total duration of the audio track in seconds

setPositionvoid

moves (seeks) the audio to a specific time in seconds

onFinishvoid

registers a function that runs when the audio finishes playing