For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Status
OverviewProductsManageAPI ReferenceTutorialsClient Libraries
OverviewProductsManageAPI ReferenceTutorialsClient Libraries
    • Overview
  • Quickstarts
    • Synthesize Your First Clip
    • Prompted Synthesis
  • Voice Creation
      • Getting Started
      • Node.js Example
      • Python Example
    • Voice Design Guide
  • WebSocket Streaming
    • Getting Started
    • Receiving Audio Data
    • Python Example
    • Error Handling
  • Prompt Engineering
    • Voice Design Prompting
    • SSML Prompts
Status
LogoLogo
On this page
  • Prerequisites
  • 1. Project setup
  • 2. Implement main.py
  • 3. Run the script
Voice CreationFrom Dataset

Python Workflow

Was this page helpful?
Previous

Custom Voice from Recordings

Next
Built with

Prerequisites

  • Resemble PRO plan or above
  • API key (RESEMBLE_API_KEY environment variable)

1. Project setup

$python3 -m venv venv
$source venv/bin/activate
$pip install resemble
$pip freeze > requirements.txt

2. Implement main.py

1import os
2from resemble import Resemble
3
4
5def initialize_resemble_client():
6 api_key = os.environ.get("RESEMBLE_API_KEY")
7 if not api_key:
8 raise EnvironmentError("RESEMBLE_API_KEY is not set")
9 Resemble.api_key(api_key)
10
11
12def create_voice():
13 voice_name = "My Voice Clone"
14 dataset = "https://example.com/dataset.zip" # Replace with your dataset URL
15
16 print(f"Submitting request to create voice: {voice_name}")
17 response = Resemble.v2.voices.create(voice_name, dataset_url=dataset)
18
19 if response["success"]:
20 voice = response["item"]
21 print(
22 f"Created {voice_name} (UUID {voice['uuid']}). Status: {voice['status']}"
23 )
24 else:
25 print("Voice creation failed", response)
26
27
28def run_main():
29 initialize_resemble_client()
30 create_voice()
31
32
33if __name__ == "__main__":
34 run_main()

Verify the dataset URL is accessible and matches a supported format.

3. Run the script

$RESEMBLE_API_KEY=... python3 main.py

The response includes the new voice UUID and current build status (e.g., initializing). Track its progress via the API or the Voices dashboard.