Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • using audio data in unity 5

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 584
    Comment on it

    1. On format and loading type

    Audio files imported in unity 5 are by default set to be preloaded i.e. audio clip will be loaded at the moment when game is being loaded.

    This can cause game to take much time to load if audio files are heavy so unity provides many options to handle such audio assets.

    Audio clips can be compressed using three different formats provided in unity PCM, vorbis and ADPCM.

    Developer can explicitly reduce file size by compromising with quality of audio files.

    Since audibility does not differ much even on greater reduces specially on wav formats.

    unity also provide ways to load audio data : preloading, decompression on loading and streaming.

    when audio file is a music piece of heavy data it can be streamed from disk rather than preloading it with game as this can save a lot of loading time.

    2. Using audio in game scene

    In a game scene any audio can be heard a la mode as events are heard. We need to attach a component by the name audio listener . Exactly one audio listener is needed to hear sound from any number of audio sources.

    Audio sources create the sound which is heard by the audio listener . Audio listener is attached to the main camera by default. More over audio listener has no properties. It only makes sounds audible through computer speaker.

    Any properties which we need to change or manipulate to use audio can be accessed in audio source.

    These audio sources can be attached as a component to any game object in the scene. More than one audio source can also be attached to a game object. But a single audio source only hold reference to a single audio clip in the inspector. if we need more than one audio clip played by the same audio source than it can be done through scripting by getting the audio source component eventually.

    Properties of audio source

    Audio source properties in inspector shows the reference to the audio clip to be played by this source.Audio clips in the asset folder can be dragged on to the audio clip field  in inspector .

    we can set volume level and priority level of source.volume is a float between 0 and 1. While priority is integer between 1 and 128. Less the priority value more it will be prominent in listening.

    Boolean mute can be checked or uncheked effectively to mute or unmute the source.

    Output field specifies if audio needs to be send to any sort of mixer before sending it to listener to be heard.

    Three bypass fields are boolean  asking whether any effect of listener or of reverb zone( a zone where sound reverberates like a cavern or cave) or any applied effects should be ignored or not.

    sound speed can be controlled by pitch slider.

    2d games do not need to show 3 d effects like fall of audibility of sound when listener moves away from source.So this can be handled by spatial blend field which is a slider type based on float value between 0 and 1.0 means strictly 2d and 1 means strictly 3d.

    More over  sound settings specifically for a 3d sound are at the disposal of the developer. Since 3d sounds are subjected to attenuation so user can decide minimum distance more than which sound becomes susceptible to  attenuation.Also developer can decide the falloff curve to be one of logarithmic ,linear or custom type. Sound behaviour in Reverb zone(like in a cave ) can be decided.

    Audio settings for project as a whole can be specifically manipulated by going to Edit/Project Settings/Audio.









 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: