Skip to content

chlesser/Audio-Stream-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Audio Stream Generator

This tool is used to create a consistent stream of music and ambiance! The sound effects and music are to be provided. It randomly delays the effects as the user desires. It is relatively easy to use, with many parameters to tune and create the perfect random ambiance. I suggest familiarizing oneself with the Unity Audio Mixer, but technically it is not required.

How to Use

Installation

  1. Download the above ASG.unitypackage
image
  1. Import it into your unity project of choice.
  2. Drag the AudioStreamGenerator prefab into your scene. Note that it does NOT carry between scenes, though you may add this yourself. It can be found in Audio/ASG/Prefabs
image

Clip Import

  1. On the importer child, specify the desired folders and the various options.
image
  1. Click import music, import ambiance, or import both.
  2. Return to the main gameObject. The list of audio clips should have been updated! Simply adjust parameters and run the tool.
image

Fine Tuning

Note that this tool does NOT update midway through the play session in many cases. Play with it by stopping and starting the scene, and see the parameter section below.

Parameters

Audio Manager

Do not edit any items in the audio manager. It is entirely for in-game usage.

Stream Generator

General Settings

  • Tracks
    • How many ambiance objects play at once. They are all on their own delays, so will stack. Increasing this will add to how much simultaneous noise is in the scene, decreasing it will decrease simultaneous noise.

Delay

  • Delay Between ambiance
    • How long, on average, the ambiance object should wait before playing the next ambiance clip.
  • Random Delay Between Ambiance
    • How far the real delay can deviate from the average. This is floored at 0.

Fade

  • Fade Control
    • What percentage of the clips are spent fading in or out.

Perlin

  • Perlin Volume
    • Whether or not to add small modifications to volume based off perlin noise.
  • Volume variation
    • How much the perlin volume variation can change from the base volume

Clips

  • Volume
    • How loud the clip is.
  • Priority
    • How likely the clip is to be chosen next. Increasing by 1 nearly doubles chance of being chosen (1->20 to 2->21), and so forth.

Importer

Target

  • Do not modify the target generator. It is the parent gameobject.

Resource Folders

  • Destinations
    • The destination of the music/ambiance folders (from root, including assets)
  • Subfolders?
    • Whether or not to search in the various subfolders of these folders. May be bugged.

Defaults

  • Sets defaults for imported clips of volume and priority above.

Import Behavior

  • Clear target list first
    • If there are already clips, clear them first.
  • Skip duplicates
    • If a clip has a clip of the same name in the list, skip importing that one.

Parse Metadata

  • If the clip is named a certain way, as: name__v0.8__p5, where what follows v is volume and what follows p is priority, it will import with that volume and priority.

Import Tools

  • Click to import to the AudioStreamGenerator!

Audio Mixer

Change volume in the audio mixer! There are also many, many effects to add. I encourage you to research it!

Volume Manager

The default master volume, music, and ambiance settings can be adjusted to maintain a consistent volume as set by the user between play sessions. This is by default set to 1, but if sliders edit this, they will update the audio mixer.

Ambiance Prefab

Technically, you can directly change the ambiance prefab's parameters, though I wouldn't recommend it. Everything is replaced by existing parameters except for speed and smoothing.

  • Speed
    • How far each call of the perlin noise goes.
  • Smooth
    • How smooth the transition between perlin and fade calls are.

Additional Features

Volume Control

The volume control can be called from other scripts, which will update the user's audio preferences for future launches. For example, if you create a slider that links to user preference of ambiance volume, music volume, and both, you can allow them to permanently adjust this.

Passes

If you want it to sound like a track is muffled, try adding in a low pass filter! This will make only low frequencies play.

Unsolved Issues

I am aware that at this time, there is no way to edit the tool midway through game play. This is an issue I hope to resolve relatively soon. Sometimes, tracks will play at the same time if they end up randomizing into playing at the same time. This will often sort itself out. If you use more (or the same amount) of tracks as uploaded sound bites, it will not play! And potentially break. Do not do this.

Iteratave Approach

In a trial run of this tool, I learned many things. Many people were confused about what each parameter did, and I hope that this documentation has improved it! The perlin noise was also clunkier to work with, so I fixed it up. I also removed perlin controlling volume from 0-100 as this was too varied, according to user feedback. I was unable to solve the midway through play issue, however.

Example

https://youtu.be/XrKSzfM1bbg

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published