Introduction
Voice Harbor API
This service provides a comprehensive solution for managing jobs and handling file transfers securely. It allows you to easily create and manage jobs, ensuring that all your multimedia and configuration files are processed reliably.
Highlevel-workflow:
- Job Managment: Create a job, select parameters and add your files.
- Submit File and Job: Submit your job and files.
- Download final results: Download results for submitted files.
Key features include:
- Job Management: Create new jobs and track job details effortlessly.
- Secure File Transfers: Upload and download files safely through temporary, secure access links.
- Encryption: All data is encrypted during transit and rest.
- Flexible File Support: Handle various file formats, ensuring compatibility with your project needs.
- User-Friendly Interface: Benefit from a modern web interface that simplifies job and file management.
- Robust Access Control: Enjoy secure interactions with verified tokens for both users and administrators.
Voice Harbor Client
A Python client for interacting with the Voice Harbor API. This client handles job creation, file uploads, and result downloads through secure signed URLs. It supports audio file formats. The client is designed to provide an end-to-end solution for managing voice processing jobs with the Voice Harbor API, offering both ease of use as a CLI tool and flexibility for integration into larger Python projects.
Features
- Job Management: Create new jobs and retrieve job details.
- File Parsing & Validation: Automatically scans an input directory and filters files by supported formats (.wav, .mp3, …).
- Secure File Uploads: Uses signed URLs to securely upload files via HTTP PUT requests.
- Job Submission: Generates a YAML job file with all job parameters and uploads it securely.
- Polling & Result Downloading: Downloads both processed files and their corresponding JSON metadata concurrently.
- Logging & Error Handling: Provides a CLI with customizable options for API URL, authorization token, input/output directories, timeout settings, agents, and more.
- Command-Line Interface (CLI): Offers detailed logging of operations and robust error management for easier troubleshooting.
Supported File Formats
The client currently supports the following file types as stereo and mono:
.wav
.mp3
.flac
.ogg
.m4a
Requirements
- Python 3.6 or higher
Python Dependencies
The client depends on the following Python packages:
requests
PyYAML
tqdm
You can install these dependencies with pip. For example, in your terminal you might run:
pip install requests pyyaml tqdm
Installation
From Source
- Clone the repository from GitHub.
- Change into the project directory.
- Install the package in editable mode using pip:
Usage
Command-Line Interface (CLI)
After installation, the CLI is available as voice-harbor-client
. The tool accepts several parameters:
- —base-url: (Required) The base URL of the Voice Harbor API.
- —token: (Required) Your authorization token.
- —inputs-dir: (Required) Directory containing input files to be processed.
- —output-dir: Directory where the downloaded results will be stored (default:
./results
). - —timeout: Timeout in seconds for waiting on file availability (default: 600).
- —interval: Polling interval in seconds to check file status (default: 10).
- —model: List of model tier to use for processing (default:
mini
). - —agents: List of agents to use for processing (default:
health-generic
). - —prefix: An optional prefix to include files containing prefix in their name.
Example Usage:
You can run the tool from the command line like this:
Programmatic Admin Usage
You will be provided with a ADMIN token by sales@nijta.com.
Generate a developer token:
Get Job’s and finilized results overview
List all developer tokens generated by admin.
List total global usage generated by all developer tokens.
The output is a JSON response represented as a dictionary with the following fields:
Programmatic Developer Usage
The client can also be used as a Python module. For example:
Immediate Job Submission and Results Download
Delayed Job Start
Simulate a delay (e.g., waiting until tomorrow to submit the job file).
Scheduled Download Use Case
In this scenario, you create and submit a job as usual. The job file (a YAML file named using the job_id) is saved locally. Then, at a later time (for example, the next day), you reinitialize your client using the same job_id and trigger the download of results.
Step 1: Job Creation and Submission (Today). Run the following script to create a job, upload input files, and submit the job file. This script also stores the job parameters locally (optionally) and writes the YAML file (named with the job_id) which can be used later to trigger the download.
Step 2: Scheduled Download (Tomorrow)
When you’re ready to download the results—say, tomorrow—you can run a separate script that reinitializes the client with the known job_id (from the YAML file name) and then calls the download function to retrieve the processed results.