Giter VIP home page Giter VIP logo

sofasonix's Introduction

Python License

SOFASonix is an advanced Python API for the Spatially-Oriented Format for Acoustics (SOFA Format) as defined by AES69-2015 - www.sofaconventions.org.

SOFASonix was initially developed as a supplementary tool for usage alongside an undergraduate project at Southampton University's Institute of Sound and Vibration Research (ISVR). The enhanced and refined version of this is now the official SOFASonix API.

Features

  • Support for the majority of standardised and stable SOFA conventions.
  • Reading/Writing of SOFA Files for each of the supported conventions.
  • Built-in convention-specific validation to ensure correct file format for export!
  • Powered by the lightweight and powerful SQLite3, providing support for different versions of each convention.
  • Simple syntax for quickly generating / reading SOFA files.

Installation

SOFASonix can be installed as a PyPI package using

pip install sofasonix

Supported Conventions

The following conventions are currently supported by SOFASonix for reading and writing, as per the SOFAConventions website:

Convention Version SOFAConventionsVersion
GeneralFIR 1.0 1.0
GeneralTF 1.0 1.0
0.5 0.1
SimpleFreeFieldHRIR 1.0 1.0
0.6 0.4
0.5 0.3
GeneralFIRE 1.0 1.0
0.6 0.1
MultiSpeakerBRIR 1.0 0.3
0.6 0.2
0.6 0.1
SimpleHeadphoneIR 1.0 0.2
0.6 0.1
0.5 0.1
SimpleFreeFieldTF 1.0 1.0
0.6 0.4
SimpleFreeFieldSOS 1.0 1.0
SingleRoomDRIR 1.0 0.3
0.5 0.1
MusicalInstrumentDirectivity 1.0 1.0
FreeFieldDirectivityTF 1.0 0.1

Note: While some of these versions are deprecated according to SOFAConventions, they have been included to maintain backwards compatibility for both older SOFA files and older applications that may be using them. It is always recommended to use the latest versions for generating files for storage.

Documentation

SOFASonix documentation and example usage is available over at the SOFASonix Wiki page.

Templates

SOFASonix supports templates for each convention for easily creating SOFA files. These templates are autogenerated with the provided TemplateGenerator. The TemplateGenerator may be used to create python templates for any convention (and version combinations) supported by SOFASonix. To learn more, refer to the SOFASonix WIKI page.

Contribute

You may contribute any improvements and fixes via regular pull-requests. These will be reviewed as per standard procedure before integration.

License

SOFASonix is licensed under BSD-3 - see the LICENSE.md file for details. Alternatively you may visit https://opensource.org/licenses/BSD-3-Clause

Authors

I.G Laghidze (Founder) - [email protected]

sofasonix's People

Contributors

onebadninja avatar peterdodds-fb avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

sofasonix's Issues

Conventions version error

Hello,

I'm having problems loading some HRTFs that have been upgraded somewhere else, but now can't be loaded with SOFAsonix, as I get the following error:

SOFAError: Incompatible SOFAConventionsVersion (1.0) and spec version (2.0) supplied. The following pairs are available for 'SimpleFreeFieldHRIR':

- Version: 1.0, Spec Version: 1.0
- Version: 0.4, Spec Version: 0.6
- Version: 0.3, Spec Version: 0.5

Would it be possible to either support the new conventions or throw a warning instead of an error?

Thank you :)

Possible memory leak when loading multiple SOFA files

In the SOFASonix/SOFASonix.py load() method, the NetCDF4 file that is used to create the SOFASonix object is closed, but the raw file is never dereferenced. It appears that because of the persistent reference, the memory held by the raw object increases when sequentially loading multiple larger SOFA files even if the reference to the SOFASonix object is removed.

I was able to resolve the issue on my local branch by adding del raw following the raw.close() on line 436 so that the object is dereferenced before garbage collection. If this solution is acceptable, I can PR my local branch.

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.