Resemble API Client Library
Project description
resemble.ai API
resemble.ai is a state-of-the-art natural voice cloning and synthesis provider. Best of all, the platform is accessible by using our public API! Sign up here to get an API token!
This repository hosts a Python library for convenient usage of the Resemble API.
Quick start
from resemble import Resemble
Resemble.api_key('your_api_key')
project = Resemble.v2.projects.get('project_uuid')
voice = Resemble.v2.voices.get('voice_uuid')
clip = Resemble.v2.clips.create_sync('project_uuid', 'voice_uuid', 'This is a test')
Streaming
The Streaming API is currently in beta and is not available to all users. Please reach out to team@resemble.ai to inquire more.
Streaming example:
from resemble import Resemble
Resemble.api_key('your_api_key')
Resemble.syn_server_url('your_resemble_synthesis_server_url') # Extra configuration required for streaming
for chunk in Resemble.v2.clips.stream('project_uuid', 'vouce_uuid', 'This is a test'):
# do something with the `chunk` of audio data, such as feeding it into a streaming audio player
pass
Deepfake Detection
Detect AI-generated or manipulated content in audio, video, and image files.
from resemble import Resemble
Resemble.api_key('your_api_key')
# Asynchronous detection (default)
detection = Resemble.v2.deepfake_detection.detect(
url='https://example.com/suspicious_audio.wav',
callback_url='https://your-site.com/webhook', # Optional: receive results via webhook
visualize=True # Optional: generate detection visualizations
)
print(f"Detection started with UUID: {detection['item']['uuid']}")
# Check detection results
results = Resemble.v2.deepfake_detection.get(detection['item']['uuid'])
print(f"Detection status: {results['item']['metrics']}")
# Synchronous detection (wait for results)
sync_results = Resemble.v2.deepfake_detection.detect(
url='https://example.com/video.mp4',
synchronous=True,
frame_length=2, # Analysis frame length in seconds
pipeline='general->facial', # Detection pipeline for images/video
max_video_fps=30 # Limit video processing FPS
)
Supported formats:
- Audio: wav, mp3, ogg, m4a, flac
- Video: mp4, mov, avi, wmv
- Image: jpg, jpeg, png, gif, webp
Development
The library files are located in resemble/
Testing
Note that currently the test suite performs real actions against the Resemble AI platform (e.g., creating projects, retrieving clips, updating voices, et cetera).
# For tests that do NOT require a voice
$ TEST_API_KEY=<...> TEST_BASE_URL=<...> python3 -m unittest
# For tests that do require a voice
$ TEST_API_KEY=<...> TEST_BASE_URL=<...> TEST_VOICE_UUID=<...> python3 -m unittest
Publishing new versions
You need the build and twine pip packages. (pip3 install build twine)
git status: Make sure your working directory has no pending changes.- Update the version attribute in
setup.py. git commit: Commit this version change.- Build the package:
make pkg.build - (optional) Publish to the test index:
make pkg.publish.test
- Publish to the index
make pkg.publish
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file resemble-1.8.0.tar.gz.
File metadata
- Download URL: resemble-1.8.0.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
159b985dc3b68952be9cf689a1d381352f9d6696fbdd46a8e82e07df0617d14a
|
|
| MD5 |
21c03223c78f324fd622816db1ca1209
|
|
| BLAKE2b-256 |
a2f108b15c3d5fc5159d6a074973e209d4f7fe6d3b5d82f930c81a2a497cae7a
|
File details
Details for the file resemble-1.8.0-py3-none-any.whl.
File metadata
- Download URL: resemble-1.8.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56fb3acdfabbef0b02a125cdeda07f80974a1b225c34d36200c45f07780b2999
|
|
| MD5 |
be2929a32f7703206852c07bdc39fa4d
|
|
| BLAKE2b-256 |
530bb86629fc5fe1dfe3ecb9776396a424e9f03f09573fb639fe60d247a0ea29
|