-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
30 lines (25 loc) · 1.07 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import audiostack
audiostack.api_key = "your key here"
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>
"""
)
tts = audiostack.Speech.TTS.create(
scriptItem=script, voice="isaac", audience={"username": "mate"}
)
tts = audiostack.Speech.TTS.remove_padding(speechId=tts.speechId)
mix = audiostack.Production.Mix.create(
speechItem=tts,
soundTemplate="chill_vibes",
)
enc = audiostack.Delivery.Encoder.encode_mix(productionItem=mix, preset="mp3_high")
enc.download(fileName="example")