Skip to content

Commit

Permalink
add silence to ambiance mix
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremynoesen committed Oct 11, 2024
1 parent 79e8419 commit 5db13d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Saul opening will be chosen as a callback to the original AI Sponge.
The available sound effects are steel sting, boowomp, vibe link (b), disgusting fog horn, "My leg!", "Oh brother this
guy stinks!", "You what?", and the dolphin censor sound. One of these is chosen at random to play at a random point per
episode. Every episode begins with the bubbles transition sound. Every episode also has background ambiance that can be
either underwater sounds or night crickets, with a chance of rain sounds on top of that.
underwater sounds night crickets, or silence, with a chance of rain sounds on top of that.

### Random Events

Expand Down
13 changes: 8 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,14 @@ async def generate(inter: discord.Interaction, topic: str) -> None:
music_loop = silence_music.append(music.fade_in(10000), 0)
while len(music_loop) < len(combined):
music_loop = music_loop.append(music, 0)
ambiance = random.choice([sfx_day, sfx_night])
ambiance_loop = ambiance
while len(ambiance_loop) < len(combined):
ambiance_loop = ambiance_loop.append(ambiance, 0)
if random.randrange(4) > 0:
if random.randrange(3) > 0:
ambiance = random.choice([ambiance_day, ambiance_night])
ambiance_loop = ambiance
while len(ambiance_loop) < len(combined):
ambiance_loop = ambiance_loop.append(ambiance, 0)
else:
ambiance_loop = AudioSegment.empty()
if random.randrange(5) > 0:
rain_loop = AudioSegment.empty()
else:
rain_loop = ambiance_rain
Expand Down

0 comments on commit 5db13d9

Please sign in to comment.