### Install requests library Source: https://github.com/omnisalegmbh/lalalai/blob/master/api-v1/python/README.md Install the required Python library for making API requests. ```bash pip install requests ``` -------------------------------- ### Start Stem Separation Task using Python Source: https://context7.com/omnisalegmbh/lalalai/llms.txt Start a stem separation task using Python. This function allows customization of stems, extraction level, splitter, and optional lead/backing vocal separation. It returns the task_id for monitoring the process. ```python import requests import time def split_stem(source_id: str, license_key: str, stem: str = "vocals", extraction_level: str = "deep_extraction", splitter: str = "auto", multivocal: str = None) -> str: """Start stem separation task. Returns task_id.""" url = "https://www.lalal.ai/api/v1/split/stem_separator/" headers = {"X-License-Key": license_key} presets = { "stem": stem, # vocals, drum, bass, piano, electric_guitar, acoustic_guitar, synthesizer, strings, wind "extraction_level": extraction_level, # deep_extraction or clear_cut "splitter": splitter, # auto, andromeda, perseus, orion, phoenix } if multivocal and stem == "vocals": presets["multivocal"] = "lead_back" # Separate lead and backing vocals response = requests.post(url, json={"source_id": source_id, "presets": presets}, headers=headers) response.raise_for_status() return response.json()["task_id"] # Extract drums from uploaded file task_id = split_stem(source_id, "YOUR_LICENSE_KEY", stem="drum", splitter="andromeda") print(f"Task started: {task_id}") # Extract vocals with lead/backing separation task_id = split_stem(source_id, "YOUR_LICENSE_KEY", stem="vocals", multivocal="lead_back") ``` -------------------------------- ### Start Stem Separation Task Source: https://context7.com/omnisalegmbh/lalalai/llms.txt Initiate a stem separation task for a given source_id. This API endpoint allows specifying the desired stem (e.g., vocals, drums), extraction level, and the neural network splitter to use. The response contains a task_id for polling. ```bash curl -X POST "https://www.lalal.ai/api/v1/split/stem_separator/" \ -H "X-License-Key: YOUR_LICENSE_KEY" \ -H "Content-Type: application/json" \ -d '{ "source_id": "abc123-source-id", "presets": { "stem": "vocals", "extraction_level": "deep_extraction", "splitter": "andromeda", "dereverb_enabled": false } }' ``` -------------------------------- ### Run Voice Conversion with lalalai_voice_converter.py Source: https://github.com/omnisalegmbh/lalalai/blob/master/api-v1/python/README.md Use this script for voice conversion tasks. It requires a user license and allows specifying input/output paths, voice pack, accent, tonality, dereverb settings, and splitter model. Use `--list` to see available voice packs. ```bash python3 lalalai_voice_converter.py --license \ [--input ] \ [--uploaded_file_id ] \ [--output ] \ [--voice_pack_id ] \ [--accent <0.0-1.0>] \ [--tonality-reference ] \ [--dereverb-enabled ] \ [--splitter ] \ [--delete ] \ [--list] ``` -------------------------------- ### Run lalalai_splitter.py script Source: https://github.com/omnisalegmbh/lalalai/blob/master/api-v1/python/README.md Execute the audio source separation script with various command-line arguments. Specify license, input, and optional output, stem, noise cancelling, dereverb, extraction level, multivocal, splitter model, and delete options. ```bash python3 lalalai_splitter.py --license \ --input \ [--output ] \ [--stem ] \ [--noise-cancelling ] \ [--dereverb-enabled ] \ [--extraction-level ] \ [--multivocal