Lyria 2
Last updated
Was this helpful?
Last updated
Was this helpful?
An advanced audio generation model designed to create high-quality audio tracks from textual prompts.
At the bottom of this page, you'll find that shows how to structure the request. Choose the code snippet in your preferred programming language and copy it into your development environment.
Generating an audio sample using this model involves sequentially calling two endpoints:
The first one is for creating and sending a music generation task to the server (returns a generation ID).
The second one is for requesting the generated audio sample from the server using the generation ID received from the first endpoint.
The code example combines both endpoint calls.
Only prompt
is a required parameter for this model (and weโve already filled it in for you in the example), but you can include optional parameters if needed to adjust the modelโs behavior. Below, you can find the corresponding ("Generate a music sample"), which lists all available parameters along with notes on how to use them.
If you need a more detailed walkthrough for setting up your development environment and making a request step by step โ feel free to use our .
This endpoint creates and sends a music generation task to the server โ and returns a generation ID and the task status.
After sending a request for music generation, this task is added to the queue. Based on the service's load, the generation can be completed in 30-40 seconds or take a bit more.
Here is an example of generation an audio file based on a prompt using the music model Lyria 2.
Listen to the track we generated:
We generated our prompt in :
Weโve written a complete code example that sequentially calls both endpoints โ you can view and copy it below. Donโt forget to replace <YOUR_AIMLAPI_KEY>
with your actual AIML API Key from your !
"Majestic orchestral film score recorded in a top-tier London studio. A full-scale symphony orchestra delivers sweeping, cinematic music with rich emotional depth. The composition features soaring themes, dynamic contrasts, and complex harmonies. Expect powerful percussion, expressive strings, and prominent French horns and timpani. The arrangement emphasizes a dramatic narrative arc with intricate orchestrations and a profound, awe-inspiring atmosphere."
The prompt to generate audio.