Skip to content

Commit

Permalink
Prepared for the release of 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
petibub committed Jan 21, 2022
1 parent 0d9ccea commit 633f146
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
Binary file modified Assets/SampleScene.unity
Binary file not shown.
2 changes: 1 addition & 1 deletion NativeCode/Plugin_Spatializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// Please note that this will only work on Unity 5.2 or higher.

#define SOFALIZER_VERSION "1.4.0-dev" // SOFAlizer version
#define SOFALIZER_VERSION "1.4.0" // SOFAlizer version

#include "AudioPluginUtil.h"
#include "mysofa.h" // include libmysofa by, Copyright (c) 2016-2021, Symonics GmbH, Christian Hoene
Expand Down
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SOFAlizer for Unity 1.3.0
# SOFAlizer for Unity 1.4.0

SOFAlizer is a SOFA-based audio spatializer for Unity. It is a Unity [native plugin](https://docs.unity3d.com/Manual/NativePlugins.html). It loads sets of spatial filters so-called [HRTFs](https://en.wikipedia.org/wiki/Head-related_transfer_function) stored in [SOFA](https://www.sofaconventions.org/) files and renders spatial audio based on a selected HRTF set. The output is a binaural signal intended to be listened to via headphones.

Currently only Windows is supported.
Currently only Windows is supported. Tested with Unity 2021.2.8f1, compiled with MS VS 2019.

Installation:
-------------
Expand All @@ -26,12 +26,20 @@ On "Run" of the scene, SOFAlizer:
* Normalizes each HRTF set relative to the HRTF for the frontal position.
* Crops the HRTFs to the length of 256 samples.
* Transforms all impulse responses to the spectral domain for fast convolution in real-time.
* Creates SOFAlizer.log with the information of the loaded HRTF sets. In order to change the loaded HRTF sets, stop the scene rendering, replace one or more of the SOFA files, and re-run the scene.

Scene parameters:
* SOFA Selector: selects the index of the processed HRTF set. The selection of the loaded HRTF sets can be done at any time in real-time. If a non-loaded HRTF set is selected, the audio will be muted.
* Debug: determines the level of debug information shown in the console (only available if compiled in the debug mode!):
* 0 ... loading information only
* 1 ... show the active HRTF set
* 2 ... show the requested and the actually used HRTF directions
* 4 ... show the actually used trajectory
The flags can be logically combined, i.e., 7 shows everything.
* IgnoreListenerOrientation: if non-zero, the listener orientation is ignored when determining the HRTF direction, i.e., only the source position is considered.

In the scene, the parameter "SOFA Selector" selects the index of the processed HRTF set. The selection of the loaded HRTF sets can be done at any time in real-time. If a non-loaded HRTF set is selected, the audio will be muted.

In order to change the loaded HRTFs, stop the scene rendering, replace one or more of the SOFA files, and re-run the scene.

Log file SOFAlizer.log will be created where the loaded files and their transformations are logged.

**Enjoy!**

Expand All @@ -41,9 +49,16 @@ Acknowledgements:

* Christian Hoene for the great libmysofa library for easy reading SOFA files: https://github.com/hoene/libmysofa


History:
--------

Version 1.4.0
=============
* IgnoreListenerOrientation: added
* Debug: interpretation changed to be able to use as a combination of debug flags
* Compiler warnings removed

Version 1.3.0
=============
* Updated by miho to current version of libmysofa (09.2021), compiled in Windows 10, Visual Studio 2019, 64bit
Expand Down

0 comments on commit 633f146

Please sign in to comment.