How to Add Atmospheric Sound Effects to Audio

Add drama and build up to your sound design

If you're looking to add drama or different environmental ambiences to your audio asset, atmospheric sound effects could be a good solution. It's possible to add atmospheric effects to a section or to an entire audio asset with AudioStack, by setting a default atmosphere (or leaving this empty), and setting each section's atmosphere.

1. Set up your Environment

import audiostack
import os

# First, paste your API key inside the quotation marks below:

audiostack.api_key = os.getenv("AUDIOSTACK_API_KEY")

2. Write your Script

In this we'll make an advert inspired by a boxing theme. We'll be using different atmospheres in different sections of our audio asset, so we'll need to break up our script using section tags, and give each of these a name.

πŸ“˜

Notice how some sections have a soundSegment?

This determines what background music the section has. Find out more here.

SCRIPT = """
<as:section name="intro">
You train and you train, it never gets easier. You just get better.
</as:section>

<as:section name="main1" soundSegment="main">
Every time the fight starts, you give your best.
</as:section>

<as:section name="main2">
Only you and your boxing gloves against the world
</as:section>

<as:section name="main3" soundSegment="main">
So you better get the best ones you can buy, go to our website this month and you'll get 50 per cent discount!
</as:section>

<as:section name="main4">
Boxing.
</as:section>
     
<as:section name="outro" soundSegment="outro">
Give it your best.
</as:section>
"""

3. Make your Audio Asset

Here's where we specify all of the voices and atmospheric effects you'd like to use in your audio. For each section, you can specify an atmospheric effect you'd like to use. If you don't need one in that section, simply don't mention it, and the default behaviour will be assumed.


print("Creating script...")
script = audiostack.Content.Script.create(scriptText=SCRIPT)

print("Generating speech...")
speech = audiostack.Speech.TTS.create(scriptItem=script, voice="isaac", sections={
    "main2": {"voice": "elora"},
    "outro": {"voice": "whispering_ethan"},
})

print("Creating mix...")
mix = audiostack.Production.Mix.create(
    speechItem=speech,
    soundTemplate="visible",
    masteringPreset="atmosphere_test",
    sections={
        "intro": {"atmosphere": "boxing_training"},
        "main1": {"atmosphere": "boxing_round_start"},
        "main3": {"atmosphere": "boxing_fighting"},
        "outro": {"atmosphere": "boxing_round_start"}
    }
)

print(mix.productionId)

print("Downloading WAV")
mix.download(fileName="boxingExample")

Full Example

import audiostack
import os

audiostack.api_key = "APIKEY"

SCRIPT = """
<as:section name="intro">
You train and you train, it never gets easier. You just get better.
</as:section>

<as:section name="main1" soundSegment="main">
Every time the fight starts, you give your best.
</as:section>

<as:section name="main2" soundSegment="main">
Only you and your boxing gloves against the world
</as:section>

<as:section name="main3">
So you better get the best ones you can buy, go to our website this month and you'll get 50 per cent discount!
</as:section>

<as:section name="main4">
Boxing.
</as:section>
     
<as:section name="outro" soundSegment="outro">
Give it your best.
</as:section>
"""

print("Creating script...")
script = audiostack.Content.Script.create(scriptText=SCRIPT)

print("Generating speech...")
speech = audiostack.Speech.TTS.create(scriptItem=script, voice="isaac", sections={
    "main2": {"voice": "elora"},
    "outro": {"voice": "whispering_ethan"},
})

print("Creating mix...")
mix = audiostack.Production.Mix.create(
    speechItem=speech,
    soundTemplate="visible",
    masteringPreset="atmosphere_test",
    sections={
        "intro": {"atmosphere": "boxing_training"},
        "main1": {"atmosphere": "boxing_round_start"},
        "main3": {"atmosphere": "boxing_fighting"},
        "outro": {"atmosphere": "boxing_round_start"}
    }
)

print(mix.productionId)

print("Downloading WAV")
mix.download(fileName="boxingExample")