Skip to main content

api.audio logo

Audiostack SDK


This is the official audiostack Python 3 SDK. This SDK provides easy access to the Audiostack API for applications written in Python.

🧐 About

This repository is actively maintained by Audiostack. For examples, recipes and api reference see the api.audio docs. Feel free to get in touch with any questions or feedback!

:book: Changelog

You can view here our updated Changelog.

🏁 Getting Started

Installation

You don't need this source code unless you want to modify it. If you want to use the package, just run:

pip install audiostack -U

Prerequisites

Python ^3.8.1

Authentication

This library needs to be configured with your account's API key which is available in your Audiostack platform. Import the audiostack package and set audiostack.api_key with the API key you got from the console:

import audiostack
audiostack.api_key = "your-key"

If you belong to multiple organizations, by default the API will use the first organization you had access to. You can specify the organization by setting the assume_org_id attribute:

audiostack.assume_org_id = "your-org-id"

Create your first audio asset

✍️ First, create a Script.

Audiostack Scripts are the first step in creating audio assets. Not only do they contain the text to be spoken, but also determine the final structure of our audio asset using the Script Syntax.

It also supports a unified SSML syntax, which is a standard way to control speech synthesis.

script = audiostack.Content.Script.create(scriptText="""
<as:section name="intro" soundsegment="intro">
Hey there, <as:placeholder id="username">friend</as:placeholder>! Welcome to Audiostack - the audio creation platform that allows you to create high quality audio assets using just a few lines of code.
</as:section>
<as:section name="main" soundsegment="main">
Whether it's a podcast, a video, a game, or an app, Audiostack has you covered. You can create voiceovers, sound effects, music, and more.
</as:section>
<as:section name="outro" soundsegment="outro">
We are excited to see what you'll create with our product!
</as:section>
""")

🎤 Now, let's read it out load.

We integrate all the major TTS voices in the market. You can browse them in our voice library.

Let's use the voice "Isaac", substitute the username placeholder with mate and download the produced files. Each section results in a seperate audio file.

tts = audiostack.Speech.TTS.create(scriptItem=script, voice="isaac", audience={"username": "mate"})
tts.download(fileName="example")

When you listen to these files, you'll notice each of them has a certain silence padding at the end. This might be useful for some use cases, but for this example, let's remove it.

tts = audiostack.Speech.TTS.remove_padding(speechId=tts.speechId)

🎛️ Now let's mix the speech we just created with a sound template.

mix = audiostack.Production.Mix.create(speechItem=tts, soundTemplate="chill_vibes")

Various sound templates consist of various segments. In our example, we're using three segments: intro, main and outro.

You can list all the sound templates to see what segments are available or even create your own!

Mixing comes with a lot of options to tune your audio to sound just right. More on this here.

🎧 At this point, we can download the mix as a wave file, or convert it to another format.

enc = audiostack.Delivery.Encoder.encode_mix(productionItem=mix, preset="mp3_high")
enc.download(fileName="example")

Easy right? 🔮 This is the final result:

https://github.com/aflorithmic/audiostack-python/assets/64603095/6948cddb-4132-40a7-b84d-457f3fc0803d

:speedboat: More quickstarts

Get started with our quickstart recipes.

Maintainers

License

This project is licensed under the terms of the MIT license.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

audiostack-2.0.2.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

audiostack-2.0.2-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

Details for the file audiostack-2.0.2.tar.gz.

File metadata

  • Download URL: audiostack-2.0.2.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.19 Linux/5.15.0-1056-aws

File hashes

Hashes for audiostack-2.0.2.tar.gz
Algorithm Hash digest
SHA256 cee8853d02da4aba651e5331f61fd6466ef2c583d02579ea75ea48d846ff9c67
MD5 33e30855d03b1382bc43d66221b1be63
BLAKE2b-256 27c0c3a3a95cb0ab3e680d46c444197cdffb4742d12a6b7bbd8ae4165b5fcc47

See more details on using hashes here.

File details

Details for the file audiostack-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: audiostack-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 35.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.19 Linux/5.15.0-1056-aws

File hashes

Hashes for audiostack-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bb75d51a5a1939e48cbd56277d3b70dcb87e6939355176e6d306dc3ee5c2e02f
MD5 35fdd1d481c4421f592a94a96149abb7
BLAKE2b-256 a24e9d57ea43e4eae744f30d3a400c0bbe07aecb58c4fc940d7e18b29a6febf3

See more details on using hashes here.

Release history Release notifications | RSS feed

4.0.0

2 files

3.1.0

2 files

3.0.0

2 files

2.10.1

2 files

2.10.0

2 files

2.9.1

2 files

2.9.0

2 files

2.8.2

2 files

2.8.1

2 files

2.8.0

2 files

2.7.1

2 files

2.7.0

2 files

2.6.0

2 files

2.5.1

2 files

2.5.0

2 files

2.3.0

2 files

2.2.0

2 files

2.1.0

2 files

2.0.6

2 files

2.0.5

2 files

2.0.4

2 files

2.0.3

2 files

This release

2.0.2 This release

2 files

2.0.1

2 files

2.0.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.1.1

2 files

0.1.0

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page