LALAL.AI API v1

repository·master·Indexed 41 days ago

https://github.com/omnisalegmbh/lalalai

API for high-quality audio source separation, voice conversion, and background music removal. Features include a stem splitter for extracting up to 10 different instrument stems, a voice converter with accent and tonality control, and tools for removing echo, reverb, and background noise. Includes Python scripts (lalalai_splitter.py, lalalai_voice_converter.py, and lalalai_demuser.py) to facilitate integration with the asynchronous API workflow.

Tokens
2.4K
Snippets
5
Records
11
Agent score
42%

What's inside LALAL.AI

  1. Use LALAL.AI Services via API

    master

    The LALAL.AI API provides access to several specialized audio processing services:

    • Stem Splitter: Separates audio into up to 10 stems, including vocals, instrumentals, drums, bass, guitars, piano, synthesizer, wind, and string instruments.
    • Voice Cloner: Enables the creation of custom voice clones.
    • Voice Changer: Provides accent and tonality control with echo estimation and intelligent routing.
    • Lead & Back Vocal Splitter: Isolates lead vocals from backing vocals.
    • Echo & Reverb Remover: Removes unwanted echo and reverberation.
    • Voice Cleaner: Removes background noise and extraneous sounds from recordings.
  2. Understand the LALAL.AI API v1 Workflow

    master

    All LALAL.AI API v1 operations follow an asynchronous lifecycle:

    1. Upload: Send your file to the /api/v1/upload/ endpoint to receive a source_id.
    2. Process: Initiate a task (splitting or voice conversion) using the source_id.
    3. Check: Periodically poll the /api/v1/check/ endpoint to monitor task status.
    4. Download: Once the task is complete, use the provided URLs to download the results.
    5. Delete (Optional): Use the /api/v1/delete/ endpoint to clean up files from LALAL.AI storage.
  3. Use lalalai_demuser.py to remove background music

    master

    The lalalai_demuser.py script is a specialized tool to remove background music from voice recordings using the /api/v1/split/demuser/ endpoint.

    python3 lalalai_demuser.py --license <user license> \
                               --input <input directory or file> \
                               [--output <output directory>] \
                               [--dereverb-enabled <true/false>] \
                               [--delete <true/false>]
  4. Access the LALAL.AI API V1

    master

    LALAL.AI provides a stable API (V1) for integrating stem splitting and audio processing into your applications. It features a rich set of capabilities, an OpenAPI specification, and a Swagger-like interface for testing endpoints.

    For Python developers, there are dedicated tools and scripts available in the api-v1/python/ directory of this repository to facilitate integration.

    Key Resources:

  5. Use lalalai_voice_converter.py for voice conversion

    master

    The lalalai_voice_converter.py script converts a voice to match a specific voice pack.

    Usage Modes:

    • New Upload: Provide --input <file>.
    • Existing Upload: Provide --uploaded_file_id <file id> to skip the upload step.
    • List Voice Packs: Run with --list to see available voice packs and exit.

    Key Parameters:

    • --voice_pack_id: The ID of the target voice (default: ALEX_KAYE).
    • --accent: Strength of accent matching (0.0 to 1.0). 0.0 keeps original; 1.0 matches target.
    • --tonality-reference: Choose source_file to keep original pitch or voice_pack to match target pitch.
    • --splitter: Choose a model (orion, perseus, phoenix, andromeda).
    python3 lalalai_voice_converter.py --license <user license> \
                                       [--input <input directory or file>] \
                                       [--uploaded_file_id <file id>] \
                                       [--output <output directory>] \
                                       [--voice_pack_id <voice pack id>] \
                                       [--accent <0.0-1.0>] \
                                       [--tonality-reference <source_file/voice_pack>] \
                                       [--dereverb-enabled <true/false>] \
                                       [--splitter <model>] \
                                       [--delete <true/false>] \
                                       [--list]
  6. Use lalalai_splitter.py for audio source separation

    master

    The lalalai_splitter.py script allows you to extract specific stems (like vocals, drums, or bass) from an audio source.

    Key Stem Behaviors:

    • voice: Uses the /split/voice_clean/ endpoint for voice cleaning. Supports --noise-cancelling (0, 1, or 2).
    • music: Uses the /split/demuser/ endpoint to remove music from voice.
    • All other stems (e.g., drum, bass, piano, guitar, synthesizer, strings, wind) use the /split/stem_separator/ endpoint.

    Important Options:

    • --extraction-level: For stem separator stems, choose between deep_extraction (more detail) or clear_cut (cleaner).
    • --multivocal: For the vocals stem, use lead_back to split into lead and backing vocals.
    • --splitter: Select a model (auto, orion, perseus, phoenix, andromeda, lynx, lyra). auto picks the latest available for the selected stem.
    python3 lalalai_splitter.py --license <user license> \
                                --input <input directory or file> \
                                [--output <output directory>] \
                                [--stem <stem option>] \
                                [--noise-cancelling <level>] \
                                [--dereverb-enabled <true/false>] \
                                [--extraction-level <level>] \
                                [--multivocal <option>] \
                                [--splitter <model>] \
                                [--delete <true/false>]
  7. Reference: lalalai_splitter.py CLI arguments

    master

    Arguments for the lalalai_splitter.py script:

    FlagDescriptionDefaultChoices
    --licenseUser license key (required)N/AN/A
    --inputInput directory or file (required)N/AN/A
    --outputOutput directorycurrent script directoryN/A
    --stemStem to extractvocalsvocals, drum, bass, piano, electric_guitar, acoustic_guitar, synthesizer, voice, strings, wind
    --filterPost-processing filter intensity10 (mild), 1 (normal), 2 (aggressive)
    --splitterNeural network typeautophoenix, orion, perseus
    --enhanced-processingEnable enhanced processingfalsetrue, false
    --noise-cancellingNoise cancelling level (for voice stem only)10 (mild), 1 (normal), 2 (aggressive)
  8. Reference: lalalai_voice_converter.py CLI arguments

    master

    Arguments for the lalalai_voice_converter.py script:

    FlagDescriptionDefaultChoices/Range
    --licenseUser license key (required)N/AN/A
    --inputInput directory or fileN/AN/A
    --uploaded_file_idPreviously uploaded file IDN/AN/A
    --outputOutput directorycurrent script directoryN/A
    --voice_pack_idVoice pack IDALEX_KAYESee API list
    --accent_enhanceAccent processing strength1.00.0 to 1.0
    --pitch_shiftingMatch target voice tonalitytruetrue, false
    --dereverb_enabledRemove echo/reverbfalsetrue, false
    --listList available voice packs and exitN/AN/A
  9. LALAL.AI API v1 Authentication and Notes

    master

    When interacting with the LALAL.AI API v1:

    • Authentication: All API requests must include your license key in the X-License-Key header.
    • Asynchronicity: Processing tasks are not instantaneous. You must poll the /api/v1/check/ endpoint to determine when a task has finished.
    • Output: Successful tasks return direct download URLs for the processed audio tracks.