Skip to main content
Version: 2.0.0

Python

Install#

pip install resemble

Usage#

Authentication#

Before using the library, set your api key.

1 2 3 from resemble import Resemble Resemble.api_key('YOUR_API_TOKEN')

Projects#

Get all projects#

from resemble import Resemble
page = 1page_size = 10
response = Resemble.v2.projects.all(page, page_size)projects = response['items']

Create a project#

from resemble import Resemble
name = 'My project'description = 'My description'is_public = Falseis_archived = Falseis_collaborative = False
response = Resemble.v2.projects.create(name, description, is_public, is_collaborative, is_archived)project = response['item']

Update a project#

from resemble import Resemble
project_uuid = '<project_uuid>'name = 'My project (archived)'description = 'My description (this project has been archived)'is_public = Falseis_archived = Trueis_collaborative = False
response = Resemble.v2.projects.update(project_uuid, name, description, is_public, is_collaborative, is_archived)project = response['item']

Get a project#

from resemble import Resemble
project_uuid = '<project_uuid>'
response = Resemble.v2.projects.get(project_uuid)project = response['item']

Delete a project#

from resemble import Resemble
project_uuid = '<project_uuid>'
response = Resemble.v2.projects.delete(project_uuid)

Voices#

Get all voices#

from resemble import Resemble
page = 1page_size = 10
response = Resemble.v2.voices.all(page, page_size)voices = response['items']

Create a voice#

from resemble import Resemble
name = 'Test Voice'
response = Resemble.v2.voices.create(name)voice = response['item']

Update a voice#

from resemble import Resemble
voice_uuid = '<uuid>'updated_name = 'Test voice'
response = Resemble.v2.voices.update(voice_uuid, updated_name)voice = response['item']

Build a voice#

from resemble import Resemble
voice_uuid = '<voice_uuid>'
response = Resemble.v2.voices.build(voice_uuid)

Get a voice#

from resemble import Resemble
voice_uuid = '<voice_uuid>'
response = Resemble.v2.voices.get(voice_uuid)voice = response['item']

Delete a voice#

from resemble import Resemble
voice_uuid = '<voice_uuid>'
response = Resemble.v2.voices.delete(voice_uuid)

Recordings#

Get all recordings#

from resemble import Resemble
voice_uuid = '<voice_uuid>'page = 1page_size = 10
response = Resemble.v2.recordings.all(voice_uuid, page, page_size)recordings = response['items']

Create a recording#

from resemble import Resemble
voice_uuid = '<voice_uuid>'name = 'recording'text = 'This is a test'is_active = Trueemotion = 'neutral'
with open("path/to/audio.wav", 'rb') as file:  response = Resemble.v2.recordings.create(voice_uuid, file, name, text, is_active, emotion)  recording = response['item']

Update a recording#

from resemble import Resemble
voice_uuid = '<voice_uuid>'recording_uuid = '<uuid>'name = 'recording'text = 'This is a test'is_active = Trueemotion = 'neutral'
response = Resemble.v2.recordings.update(voice_uuid, recording_uuid, name, text, is_active, emotion)recording = response['item']

Get a recording#

from resemble import Resemble
voice_uuid = '<voice_uuid>'recording_uuid = '<recording_uuid>'
response = Resemble.v2.recordings.get(voice_uuid, recording_uuid)recording = response['item']

Delete a recording#

from resemble import Resemble
voice_uuid = '<voice_uuid>'recording_uuid = '<recording_uuid>'
response = Resemble.v2.recordings.delete(voice_uuid, recording_uuid)

Clips#

Get all clips#

from resemble import Resemble
project_uuid = '<project_uuid>'page = 1page_size = 10
response = Resemble.v2.clips.all(project_uuid, page, page_size)clips = response['items']

Create a clip (sync)#

from resemble import Resemble
project_uuid = '<project_uuid>'voice_uuid = '<voice_uuid>'body = 'This is a sync test'
response = Resemble.v2.clips.create_sync(  project_uuid,  voice_uuid,  body,  title=None,  sample_rate=None,  output_format=None,  precision=None,  include_timestamps=None,  is_public=None,  is_archived=None,  raw=None)
clip = response['item']

Create a clip (async)#

from resemble import Resemble
project_uuid = '<project_uuid>'voice_uuid = '<voice_uuid>'callback_uri = 'https://example.com/callback/resemble-clip'body = 'This is an async test'
response = Resemble.v2.clips.create_async(  project_uuid,  voice_uuid,  callback_uri,  body,  title=None,  sample_rate=None,  output_format=None,  precision=None,  include_timestamps=None,  is_public=None,  is_archived=None)clip = response['item']

Update a clip (async)#

from resemble import Resemble
project_uuid = '<project_uuid>'clip_uuid = '<clip_uuid>'voice_uuid = '<voice_uuid>'callback_uri = 'https://example.com/callback/resemble-clip'body = 'This is an updated async test'
response = Resemble.v2.clips.update_async(  project_uuid,  clip_uuid,  voice_uuid,  callback_uri,  body,  title=None,  sample_rate=None,  output_format=None,  precision=None,  include_timestamps=None,  is_public=None,  is_archived=None)clip = response['item']

Get a clip#

from resemble import Resemble
project_uuid = '<project_uuid>'clip_uuid = '<clip_uuid>'
response = Resemble.v2.clips.get(project_uuid, clip_uuid)clip = response['item']

Delete a clip#

from resemble import Resemble
project_uuid = '<project_uuid>'clip_uuid = '<clip_uuid>'
response = Resemble.v2.clips.delete(project_uuid, clip_uuid)