Skip to main content

api.audio logo

audiostack SDK


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

Maintainers

License

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

🧐 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.

:speedboat: Quickstarts

Get started with our quickstart recipes.

🏁 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
#or
pip3 install audiostack -U

Prerequisites

Python 3.6+

🚀 Hello World

Create a file hello.py

touch hello.py

Authentication

This library needs to be configured with your account's api-key which is available in your api.audio Console. 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"

Create Text to audio in 4 steps

Let's create our first audio asset.

✍️ Create a new script, our scriptText will be the text that is later synthesized.

script = audiostack.Content.Script.create(scriptText="hello world")
print(script.message, script.scriptId)

🎤 Render the scriptText that was created in the previous step. Lets use voice Aria. Lets download our tts file also.

tts = audiostack.Speech.TTS.create(scriptItem=script, voice="Aria")
print(tts)
tts.download(autoName=True)

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

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

Lets convert out produced mix into a mp3 and download it.

enc = audiostack.Delivery.Encoder.encode_mix(productionItem=mix, preset="mp3_low")
enc.download()

Easy right? 🔮 This is the final hello.py file.

import audiostack
audiostack.api_key = "your-key"

script = audiostack.Content.Script.create(scriptText="hello world")
print(script.message, script.scriptId)

tts = audiostack.Speech.TTS.create(scriptItem=script, voice="Aria")
print(tts)
tts.download(autoName=True)

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

enc = audiostack.Delivery.Encoder.encode_mix(productionItem=mix, preset="mp3_low")
enc.download()

Now let's run the code:

python hello.py
#or
python3 hello.py

Once this has completed, find the downloaded audio asset and play it! :sound: :sound: :sound:

Import

import audiostack

Authentication

The library needs to be configured with your account's secret key which is available in your Aflorithmic Dashboard. Set audiostack.api_key with the api-key you got from the dashboard:

audiostack.api_key = "your-key"

Authentication with environment variable (recommended)

You can also authenticate using audiostack_key environment variable and the audiostack SDK will automatically use it. To setup, open the terminal and type:

export audiostack_key=<your-key>

If you provide both an environment variable and audiostack.api_key authentication value, the audiostack.api_key value will be used instead.

Download files

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

Source Distribution

audiostack-1.0.4.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

audiostack-1.0.4-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: audiostack-1.0.4.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for audiostack-1.0.4.tar.gz
Algorithm Hash digest
SHA256 d733b43ab3daf6ffb9a7cbe5906018500d518d3cd965eea6c3f799566287b0a0
MD5 e33d25a8ab3ae3b316d26158a409b518
BLAKE2b-256 b79e03abd6d1c21328f38ff8bf269848768a1983995897ea5b7c85ea17080e70

See more details on using hashes here.

File details

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

File metadata

  • Download URL: audiostack-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for audiostack-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f9f70d93c53beb1fe5a7def5222d08fa5f94e6a6c1caaeef7920702d11dc9aa8
MD5 5ca69a1fcef2d361a261bd8972f82c5c
BLAKE2b-256 312811093e5af941ae53a648077dd60044ca91cac002dbd6e9bc33242b3edb67

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

2.0.2

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

This release

1.0.4 This release

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