Skip to content

Commit

Permalink
Added HeSuVi HRIR resampler
Browse files Browse the repository at this point in the history
  • Loading branch information
ThreeDeeJay committed May 28, 2021
1 parent d8d5dfe commit a00510a
Show file tree
Hide file tree
Showing 27 changed files with 2,613 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ Converts all the .SOFA files in the script folder to OpenAL Soft .MHR files (441
# SOFA to WAV
Converts all the .SOFA files in the script folder to HeSuVi .WAV files files (44100hz and 48000hz) and opens the output/ and hrir/ folders for easy drag and drop installation.

# Resample
Generates 44.hkhz WAV file for HeSuVi WAV files, if missing.

# Contact
For more updates, troubleshooting or contribution, join the discussion at the [3D Game Audio Discord server](https://kutt.it/U3DAMChat).
For more updates, troubleshooting or contribution, join the discussion at the [Binaural Audio Discord server](https://kutt.it/U3DAMChat).

# Credits:
[kcat](https://github.com/kcat) - [makehrtf/makemhr](https://github.com/kcat/openal-soft/tree/e0097c18b82d5da37248c4823fde48b6e0002cdd/utils/makemhr)
[Matt Gore](https://sourceforge.net/u/jak33/profile/), [Jaakko Pasanen](https://sourceforge.net/u/jaakkopasanen/profile/) - [SOFA to HeSuVi conversion setup](https://sourceforge.net/p/hesuvi/wiki/How-To%20Record%20Impulse%20Responses%20Digitally/)
[FFmpeg team](https://ffmpeg.org/developer.html) - [FFmpeg](https://ffmpeg.org/)
[Christian Hoene](https://github.com/hoene) - [libmysofa](https://github.com/hoene/libmysofa)
[Chris Bagwell](http://www.cnpbagwell.com/) - [SoX](http://sox.sourceforge.net/)
1,759 changes: 1,759 additions & 0 deletions Resources/SoX/ChangeLog.txt

Large diffs are not rendered by default.

339 changes: 339 additions & 0 deletions Resources/SoX/LICENSE.GPL.txt

Large diffs are not rendered by default.

196 changes: 196 additions & 0 deletions Resources/SoX/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
SoX: Sound eXchange
===================

SoX (Sound eXchange) is the Swiss Army knife of sound processing tools: it
can convert sound files between many different file formats & audio devices,
and can apply many sound effects & transformations, as well as doing basic
analysis and providing input to more capable analysis and plotting tools.

SoX is licensed under the GNU GPL and GNU LGPL. To be precise, the 'sox'
and 'soxi' programs are distributed under the GPL, while the library
'libsox' (in which most of SoX's functionality resides) is dual-licensed.
Note that some optional components of libsox are GPL only: if you use these,
you must use libsox under the GPL. See INSTALL for the list of optional
components and their licences.

If this distribution is of source code (as opposed to pre-built binaries),
then you will need to compile and install SoX as described in the 'INSTALL'
file.

Changes between this release and previous releases of SoX can be found in
the 'ChangeLog' file; a summary of the file formats and effects supported in
this release can be found below. Detailed documentation for using SoX can
be found in the distributed 'man' pages:

o sox(1)
o soxi(1)
o soxformat(7)
o libsox(3)

or in plain text or PDF files for those systems without man.

The majority of SoX features and fixes are contributed by SoX users - thank
you very much for making SoX a success! There are several new features
wanted for SoX, listed on the feature request tracker at the SoX project
home-page:

http://sourceforge.net/projects/sox

users are encouraged to implement them!

Please submit bug reports, new feature requests, and patches to the relevant
tracker at the above address, or by email:

mailto:[email protected]

Also accessible via the project home-page is the SoX users' discussion
mailing list which you can join to discuss all matters SoX with other SoX
users; the mail address for this list is:

mailto:[email protected]

The current release handles the following audio file formats:


o Raw files in various binary formats
o Raw textual data
o Amiga 8svx files
o Apple/SGI AIFF files
o SUN .au files
o PCM, u-law, A-law
o G7xx ADPCM files (read only)
o mutant DEC .au files
o NeXT .snd files
o AVR files
o CDDA (Compact Disc Digital Audio format)
o CVS and VMS files (continuous variable slope)
o Grandstream ring-tone files
o GSM files
o HTK files
o LPC-10 files
o Macintosh HCOM files
o Amiga MAUD files
o AMR-WB & AMR-NB (with optional libamrwb & libamrnb libraries)
o MP2/MP3 (with optional libmad, libtwolame and libmp3lame libraries)
o Opus files (read only; with optional Opus libraries)

o Ogg Vorbis files (with optional Ogg Vorbis libraries)
o FLAC files (with optional libFLAC)
o IRCAM SoundFile files
o NIST SPHERE files
o Turtle beach SampleVision files
o Sounder & Soundtool (DOS) files
o Yamaha TX-16W sampler files
o SoundBlaster .VOC files
o Dialogic/OKI ADPCM files (.VOX)
o Microsoft .WAV files
o PCM, floating point
o u-law, A-law, MS ADPCM, IMA (DMI) ADPCM
o GSM
o RIFX (big endian)
o WavPack files (with optional libwavpack library)
o Psion (palmtop) A-law WVE files and Record voice notes
o Maxis XA Audio files
o EA ADPCM (read support only, for now)
o Pseudo formats that allow direct playing/recording from most audio devices
o The "null" pseudo-file that reads and writes from/to nowhere


The audio effects/tools included in this release are as follows:

o Tone/filter effects
o allpass: RBJ all-pass biquad IIR filter
o bandpass: RBJ band-pass biquad IIR filter
o bandreject: RBJ band-reject biquad IIR filter
o band: SPKit resonator band-pass IIR filter
o bass: Tone control: RBJ shelving biquad IIR filter
o equalizer: RBJ peaking equalisation biquad IIR filter
o firfit+: FFT convolution FIR filter using given freq. response (W.I.P.)
o highpass: High-pass filter: Single pole or RBJ biquad IIR
o hilbert: Hilbert transform filter (90 degrees phase shift)
o lowpass: Low-pass filter: single pole or RBJ biquad IIR
o sinc: Sinc-windowed low/high-pass/band-pass/reject FIR
o treble: Tone control: RBJ shelving biquad IIR filter

o Production effects
o chorus: Make a single instrument sound like many
o delay: Delay one or more channels
o echo: Add an echo
o echos: Add a sequence of echos
o flanger: Stereo flanger
o overdrive: Non-linear distortion
o phaser: Phase shifter
o repeat: Loop the audio a number of times
o reverb: Add reverberation
o reverse: Reverse the audio (to search for Satanic messages ;-)
o tremolo: Sinusoidal volume modulation

o Volume/level effects
o compand: Signal level compression/expansion/limiting
o contrast: Phase contrast volume enhancement
o dcshift: Apply or remove DC offset
o fade: Apply a fade-in and/or fade-out to the audio
o gain: Apply gain or attenuation; normalise/equalise/balance/headroom
o loudness: Gain control with ISO 226 loudness compensation
o mcompand: Multi-band compression/expansion/limiting
o norm: Normalise to 0dB (or other)
o vol: Adjust audio volume

o Editing effects
o pad: Pad (usually) the ends of the audio with silence
o silence: Remove portions of silence from the audio
o splice: Perform the equivalent of a cross-faded tape splice
o trim: Cuts portions out of the audio
o vad: Voice activity detector

o Mixing effects
o channels: Auto mix or duplicate to change number of channels
o divide+: Divide sample values by those in the 1st channel (W.I.P.)
o remix: Produce arbitrarily mixed output channels
o swap: Swap pairs of channels

o Pitch/tempo effects
o bend: Bend pitch at given times without changing tempo
o pitch: Adjust pitch (= key) without changing tempo
o speed: Adjust pitch & tempo together
o stretch: Adjust tempo without changing pitch (simple alg.)
o tempo: Adjust tempo without changing pitch (WSOLA alg.)

o Mastering effects
o dither: Add dither noise to increase quantisation SNR
o rate: Change audio sampling rate

o Specialised filters/mixers
o deemph: ISO 908 CD de-emphasis (shelving) IIR filter
o earwax: Process CD audio to best effect for headphone use
o noisered: Filter out noise from the audio
o oops: Out Of Phase Stereo (or `Karaoke') effect
o riaa: RIAA vinyl playback equalisation

o Analysis `effects'
o noiseprof: Produce a DFT profile of the audio (use with noisered)
o spectrogram: graph signal level vs. frequency & time (needs `libpng')
o stat: Enumerate audio peak & RMS levels, approx. freq., etc.
o stats: Multichannel aware `stat'

o Miscellaneous effects
o ladspa: Apply LADSPA plug-in effects e.g. CMT (Computer Music Toolkit)
o synth: Synthesise/modulate audio tones or noise signals
o newfile: Create a new output file when an effects chain ends.
o restart: Restart 1st effects chain when multiple chains exist.

o Low-level signal processing effects
o biquad: 2nd-order IIR filter using externally provided coefficients
o downsample: Reduce sample rate by discarding samples
o fir: FFT convolution FIR filter using externally provided coefficients
o upsample: Increase sample rate by zero stuffing

+ Experimental or incomplete effect; may change in future.

Multiple audio files can be combined (and then further processed with
effects) using any one of the following combiner methods:

o concatenate
o mix
o merge: E.g. two mono files to one stereo file
o sequence: For playing multiple audio files/streams
167 changes: 167 additions & 0 deletions Resources/SoX/README.win32.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
SoX
---

This file contains information specific to the Win32 version of SoX.
Please refer to the README file for general information.

The binary SOX.EXE can be installed anywhere you desire. The only
restriction is that the included ZLIB1..DLL and LIBGOMP-1.DLL must be
located in the same directory as SOX.EXE or somewhere within your PATH.

SoX Helper Applications
-----------------------

SoX also includes support for SOXI.EXE, PLAY.EXE and REC.EXE and their
behaviors are documented in included PDF's. They have the same
install restrictions as SOX.EXE.

SOXI.EXE, PLAY.EXE, and REC.EXE are not distributed with this package to
reduce size requirements. They are, in fact, only copies of the original
SOX.EXE binary which changes SOX.EXE's behavior based on the
executable's filename.

If you wish to make use of these utils then you can create them
yourself.

copy sox.exe soxi.exe
copy sox.exe play.exe
copy sox.exe rec.exe

If you are concerned with disk space, the play and record
functionality can be equated using the "-d" option with SOX.EXE. soxi
functionality can be equated using the "--info" option with SOX.EXE. The
rough syntax is:

play: sox [input files and options] -d [effects]
rec: sox -d [output file and options] [effects]
soxi: sox --info [input files and options]

Acknowledgements
----------------

SOX.EXE included in this package makes use of the following projects.
See the cygbuild script included with the source code package for
further information on how it was compiled and packaged.

SoX - http://sox.sourceforge.net

FLAC - http://flac.sourceforge.net

LADSPA - http://www.ladspa.org

libid3tag - http://www.underbit.com/products/mad

libsndfile - http://www.mega-nerd.com/libsndfile

Ogg Vorbis - http://www.vorbis.com

PNG - http://www.libpng.org/pub/png

WavPack - http://www.wavpack.com

wget - http://www.gnu.org/software/wget

Enjoy,
The SoX Development Team

Appendix - wget Support
-----------------------

SoX can make use of the wget command line utility to load files over
the internet. A binary copy of wget has been included with this
package of SoX for your convience.

For SoX to make use of wget, it must be located either in your PATH or
within the same directory that SoX is ran from.

Custom configuration of wget can be made by editing the file wget.ini
contained in the same directory as wget.exe.

Please consult wget's homepage for access to source code as well as
further instructions on configuring.

http://www.gnu.org/software/wget

Appendix - MP3 Support
----------------------

SoX contains support for reading and writing MP3 files but does not ship
with the DLL's that perform decoding and encoding of MP3 data because
of patent restrictions. For further details, refer to:

http://en.wikipedia.org/wiki/MP3#Licensing_and_patent_issues

MP3 support can be enabled by placing Lame encoding DLL and/or
MAD decoding DLL into the same directory as SOX.EXE. These
can be compiled yourself, they may turn up on searches of the internet
or may be included with other MP3 applications already installed
on your system. For encoding/writing, try searching for lame-enc.dll,
libmp3lame-0.dll, libmp3lame.dll, or cygmp3lame-0.dll. For
decoding/reading, try searching for libmad-0.dll, libmad.dll or cygmad-0.dll.

Instructions are included here for using MSYS to create the DLL's.
It is assumed you already have MSYS installed on your system
with a working gcc compiler. The commands are ran from MSYS
bash shell.

Obtain the latest Lame and MAD source code from approprate locations.

Lame MP3 encoder http://lame.sourceforge.net
MAD MP3 decoder http://www.underbit.com/products/mad

cd lame-398-2
./configure --disabled-static --enable-shared
make
cp libmp3lame/.libs/libmp3lame-0.dll /path/to/sox

MAD libraries up to 0.15.1b have a bug in configure that will not allow
building DLL under mingw. This can be resolved by adding LDFLAGS
to configure and editing the generated Makefile to remove an invalid
option.

cd libmad-0.15.1b
./configure --enable-shared --disable-static LDFLAGS="-no-undefined"
[edit Makefile, search for "-fforce-mem" and delete it.]
make
cp libmad-0.dll /path/to/sox/

Appendix - AMR-NB/AMR-WB Support
--------------------------------

SoX contains support for reading and writing AMR-NB and AMR-WB files but
does not ship with the DLL's that perform decoding and encoding of AMR
data because of patent restrictions.

AMR-NB/AMR-WB support can be enabled by placing required DLL's
into the same directory as SOX.EXE. These can be compiled yourself,
they may turn up on searches of the internet or may be included with other
MP3 applications already installed on your system. For AMR-NB support,
try searching for libamrnb-3.dll, libopencore-amrnb-0.dll, or
libopencore-amrnb.dll. For AMR-WB support, try searching for libamrwb-3.dll,
libopencore-amrwb-0.dll, or libopencore-amrwb.dll.

Instructions are included here for using MSYS to create the DLL's.
It is assumed you already have MSYS installed on your system with
working gcc compiler. These commands are ran from MSYS bash shell.

Obtain the latest amrnb and amrwb source code from
http://sourceforge.net/projects/opencore-amr .

cd opencore-amr-0.1.2
./configure --enable-shared --disable-static LDFLAGS="-no-undefined"
make
cp amrnb/.libs/libopencore-amrnb-0.dll /path/to/sox
cp amrwb/.libs/libopencore-amrwb-0.dll /path/to/sox

Appendix - LADSPA Plugins
-------------------------

SoX has built in support for LADSPA Plugins. These plugins are
mostly built for Linux but some are available for Windows.
The Audacity GUI application has a page that points to a collection
of Windows LADSPA plugins.

http://audacity.sourceforge.net/download/plugins

SoX will search for these plugins based on LADSPA_PATH
enviornment variable. See sox.txt for further information.
14 changes: 14 additions & 0 deletions Resources/SoX/batch-example.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
rem Example of how to do batch processing with SoX on MS-Windows.
rem
rem Place this file in the same folder as sox.exe (& rename it as appropriate).
rem You can then drag and drop a selection of files onto the batch file (or
rem onto a `short-cut' to it).
rem
rem In this example, the converted files end up in a folder called `converted',
rem but this, of course, can be changed, as can the parameters to the sox
rem command.

cd %~dp0
mkdir converted
FOR %%A IN (%*) DO sox %%A "converted/%%~nxA" rate -v 44100
pause
Binary file added Resources/SoX/libflac-8.dll
Binary file not shown.
Binary file added Resources/SoX/libgcc_s_sjlj-1.dll
Binary file not shown.
Binary file added Resources/SoX/libgomp-1.dll
Binary file not shown.
Binary file added Resources/SoX/libid3tag-0.dll
Binary file not shown.
Binary file added Resources/SoX/libogg-0.dll
Binary file not shown.
Binary file added Resources/SoX/libpng16-16.dll
Binary file not shown.
Binary file added Resources/SoX/libsox-3.dll
Binary file not shown.
Binary file added Resources/SoX/libssp-0.dll
Binary file not shown.
Binary file added Resources/SoX/libvorbis-0.dll
Binary file not shown.
Binary file added Resources/SoX/libvorbisenc-2.dll
Binary file not shown.
Binary file added Resources/SoX/libvorbisfile-3.dll
Binary file not shown.
Binary file added Resources/SoX/libwavpack-1.dll
Binary file not shown.
Binary file added Resources/SoX/libwinpthread-1.dll
Binary file not shown.
Binary file added Resources/SoX/sox.exe
Binary file not shown.
Binary file added Resources/SoX/sox.pdf
Binary file not shown.
Binary file added Resources/SoX/soxformat.pdf
Binary file not shown.
Binary file added Resources/SoX/soxi.pdf
Binary file not shown.
Binary file added Resources/SoX/wget.exe
Binary file not shown.
Loading

0 comments on commit a00510a

Please sign in to comment.