Skip to content

ai-coustics/api-tutorials

Repository files navigation

ai|coustics API Examples

Welcome to the ai|coustics API Python Examples repository! This repository contains example scripts and tutorials on how to use the ai|coustics API with Python.

Overview

ai|coustics provides AI-driven speech enhancement to enriching media experiences and natural conversations. This repository provides sample code to help you quickly integrate the ai|coustics API into your Python applications.

Getting Started

Prerequisites

  • Python 3.10+
  • An ai|coustics API key. You can get one by signing up on our developer portal.

Installation & Usage

  1. Clone the repository:
git clone https://github.com/ai-coustics/api-tutorials.git
cd api-tutorials
  1. Create a virtual environment, activate it, and install the dependencies:

    • Recommended: using the poetry (documentation)
    • Or by using the python venv module and the requirements.txt file
  2. Create the .env file that would include API_KEY and optionally the WEBHOOK_SIGNATURE values. Check the description of the environment values at the configs.py

  3. Review and run the examples. The upload.py and download.py are simple examples. The advanced.py is implementing the whole cycle: uploading, catching an update using webhook, and downloading an enhanced media file.

How to run the examples:

  1. The .env file has required API_KEY and optional WEBHOOK_SIGNATURE variables values.
  2. Every example file has the entry point in the bottom where you can set your values. For instance in the download.py you are required to set the generated_name variable value, as a generated name of a file is unique.

Advanced example: since the advanced.py is using the webhook, you should consider following:

  • The address of a server, that is started when you run the advanced.py script, shold be made accessible on the internet. There are multimple options of how you can do this, but for testing you can consider such free services like ngrok. Such services let you expose your local address on the internet easily.
  • At the entry point you can change the default values of the webhook_server_host and webhook_server_port variables, which are "localhost" and 8002 respectively.
  • To better understand where media files are comming from, review the mocks.py file and change the mock_get_media_queue_period variable's value.

Documentation

You can find the full API documentation here.

License

This project is licensed under the MIT License.

Contact

For any questions, feel free to reach out to us at [email protected] or visit our website ai-coustics.com.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages