Coder Social home page Coder Social logo

villeojala / fmod-unity-tools Goto Github PK

View Code? Open in Web Editor NEW
46.0 4.0 4.0 263 KB

Audio implementation tools for FMOD and Unity

License: MIT License

C# 100.00%
fmod unity game-audio spatial-audio audio obstruction occlusion propagation ambience footsteps

fmod-unity-tools's Introduction

FMOD-Unity-Tools

Audio Implementation Tools for FMOD and Unity
MIT License
Copyright 2022, Ville Ojala

A synergistic set of audio implementation tools for the interface of Unity game engine and FMOD audio middleware.

  • Assorted triggering, playback and randomization features
  • Integration with various Unity subsystems (Timeline, Animator, Animation Clips etc.)
  • Ambience area system for implementing seamless door transitions and large sound sources
  • Reverb zone system with blend areas
  • Third person footstep system (no animation keyframe tagging required)
  • Surface tagging and detection system (both mesh and Terrain texture -based)
  • Voiceover system with dialogue queuing and pacing tools
  • Room-portal -based sound occlusion system
  • Raycast-based obstruction

User Guide

Third party dependencies:

  • FMOD version: 2.02.09 (Unity verified)
  • Tested in Unity version: 2021.3.7f1 (LTS)

fmod-unity-tools's People

Contributors

ianberman avatar villeojala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fmod-unity-tools's Issues

KeyNotFoundException when instanceToListenerDistances already cleared & emitter > Max Distance

KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0)
FMODUnityTools.SpatialAudioManager.CalculatePropagationCosts (System.Collections.Generic.List`1[T] instances) (at Assets/Plugins/AudioTools/Scripts/Runtime/Extensions/SpatialAudioSystem/SpatialAudioManager.cs:830)
FMODUnityTools.SpatialAudioManager.LateUpdate () (at Assets/Plugins/AudioTools/Scripts/Runtime/Extensions/SpatialAudioSystem/SpatialAudioManager.cs:374)

I believe this is happening because instanceToListenerDistances is being cleared before CheckInstanceAudibility() and later CalculatePropagationCosts() are called.

Steps to reproduce:
Place an emitter within one room, then move the player/listener to another room, and walk out of range (beyond the FMOD event's max distance).

Steps I tried to solve:
Only calling CalculatePropagationCosts() if instanceToListenerDistances > 0
However it breaks again if you have more than one emitter and you're out of range of one, while being within range of the other.

Let me know if I am overlooking something, or I will take another look later this week :)

PropagationCost = 1 when player stands directly on portal to higher priority room, and sound is in lower priority room

I noticed a slight gap in audio when you move from a lower priority room to a higher priority room (eg. from a room with priority 1 to a room with priority 2). Looking at the debugger in the Spatial Audio Manager, I can confirm that PropagationCost = 1 when the player is standing directly on the portal.

Steps to reproduce:
Place sound emitter in a lower priority room, and position player to stand directly on a portal to a higher priority room. I only tested this if the higher priority room is nested within a larger, lower priority room. I'm not sure if it happens if they are adjacent and not nested.

(our game is also first-person, so the listener position can be quite specific)

Fixed Room makes PropagationCost = 1

Hi!

I think I ran into a bug: if Fixed Room is checked in the script Audio Object, the PropagationCost will be 1, even if the listener is standing directly outside of an open portal. When I turn Fixed Room off, it seems to be calculating PropagationCost as expected again.

I noticed a related issue in the ambience system, where PropagationCost = 1 for any ambience coming out of a portal -- only if it is assigned a Spatial Audio Room in the Ambience Area script. Possibly it's the same thing.

Let me know if I'm misunderstanding something about this or set it up incorrectly - thank you! :)
Ian

Duplicate key in dictionary roomPairs

Hi Ville,

First of all, thanks (again) for all your great work on this tool, it provides a ton of much needed functionality for my game, and has been a much better implementation of many features than my small team cobbled together previously.

Upon finalizing our map, I've been implementing the spatial audio system on a larger scale than previously tested, and ran into an error with the roomPairs dictionary.

ArgumentException: An item with the same key has already been added. Key: 111
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <695d1cc93cca45069c528c15c9fdd749>:0)
FMODUnityTools.SpatialAudioManager.InitializeRoomPairRouteAlternatives () (at Assets/Plugins/AudioTools/Scripts/Runtime/Extensions/SpatialAudioSystem/SpatialAudioManager.cs:821)
FMODUnityTools.SpatialAudioManager.Awake () (at Assets/Plugins/AudioTools/Scripts/Runtime/Extensions/SpatialAudioSystem/SpatialAudioManager.cs:225)

Through poking around in the debugger, it appears that key 111 was set early on, at index [9] of looping through roomPairs.Add(roomPairID, roomPair); and in our game, corresponds to roomA = Outside_General and roomB = Home_Bedroom_Parents. This was given index 111.

I believe the error is caused when it's looking to add the reverse (Bedroom to Outside) and wanting to also set that as key 111. For more info, please see below screenshots.

Let me know if I can do anything to help troubleshoot, or if I'm overlooking something simple. Thank you!
Screen Shot 2023-03-17 at 9 13 25 PM

Screen Shot 2023-03-17 at 9 13 58 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.