Overview
AudioStack allows you to choose from a variety of sound templates, which will then be mixed and mastered along with a speech track.
Let me listen to how it sounds!
import os
import audiostack
audiostack.api_key = os.getenv("API_KEY")
text = """
Testing Some great voices with some background music
"""
# Listen and share your audio file
VOICE = "renata"
SOUND_TEMPLATE="acousticstrings"
try:
script = audiostack.Content.Script.create(scriptText=text,
scriptName="testing")
scriptId = script.scriptId
item = audiostack.Speech.TTS.create(scriptItem=script, voice=VOICE)
# simple syntax, get TTS and then download
item = audiostack.Speech.TTS.get(item.speechId)
mix = audiostack.Production.Mix.create(speechItem=item,
masteringPreset="balanced",
soundTemplate=SOUND_TEMPLATE,
forceLength=10.0)
encoder = audiostack.Delivery.Encoder.encode_mix(productionItem=mix,
preset="mp3")
encoder.download(fileName=f"{script.scriptName}__{VOICE}_{SOUND_TEMPLATE}",
path=".")
except Exception as e:
print(e)
print("FAILED GENERATING SCRIPT: ")
print("Cost for this session: ", audiostack.credits_used_in_this_session())
In this example we've added a masteringPreset (which adjusts the sound of the audio), we use Production.Mix to create the mix. This is mixing together elements. You'll notice that our elements consist of speech, a masteringPreset, a soundTemplate (which is the background to your audio), and we also specify forceLength which is great for adding to video content.
Afterwards we use the encoder to make the audio work for delivery, in this example we've passed in out mix and a preset (preset lets you specify mp3 or wav for example.
What is mastering
Mastering allows you to create and retrieve a mastered audio file that is ready to be played or broadcasted. A mastered version contains the speech of the script, a background track, personalised tracks for your audience, and a mastering process to enhance the audio quality of the whole track.
In order to get a mastered audio file, make sure you requested speech for your script resource first.
Features
- Sound design - Sound design automation makes sure that the music layer will always fit perfectly to the speech layer of your audio, regardless of the length.
- Sound Discoverability - AudioStack's sound design library offers a selection of different sounds covering a range of common themes or use cases. Filter to find the perfect template for your use case. Choose from our library of sound templates and mix and master it along with your speech track to create beautiful audio programmatically in a matter of seconds.
- Time and length alignment - Set the length of each section of your audio to end at a specific time. For example you might want your ad to be exactly 30 seconds long or you might want your audio to fit to specific transitions in your video.
Updated 5 months ago