Commit Graph

10 Commits

Author SHA1 Message Date
bjorn 2da18d419b mv util src; 2022-03-22 00:13:38 -07:00
bjorn 6f3e46d8cf Fix some pointer formatting; 2022-02-02 12:01:38 -08:00
Nevyn Bengtsson 6566423f66 Sound:setFrames should use a stream's write buffer size, not read buffer size
otherwise you can never fill up a stream from scratch
2021-05-31 09:07:38 -06:00
bjorn 5d542eb2ea Minor Sound cleanup; 2021-02-24 14:11:49 -07:00
bjorn 7d0dfc9cdd Sound: Ambisonic support;
Add support for importing ambisonic WAV files and 24/32 bit PCM WAV files.

The standard ambisonic format used internally in LÖVR is ACN channel ordering with SN3D normalization.
Anything else will be converted to this form.

There are a few restrictions and assumptions:

- Only 1st order ambisonics are supported.  They need to have 4 channels.
- They can be in AMB format (Furse-Malham order/normalization), detected via WAVE_EXTENSIBLE GUID.
- Any other 4 channel file is assumed to be in "AmbiX" ACN/SN3D format.
  - It seems that most ambisonic files in the wild that claim to be AmbiX are just 4 channel WAVs without any metadata.
  - This means that non-ambisonic 4 channel WAVs could ambiguously be mistaken as ambisonic.  This is incurred as a limitation of LÖVR.
- Ambisonic files can not currently be played back.  SteamAudio currently has numerous bugs with this.
  - Perhaps it would be possible to write an ambisonic rotator/panning decoder to use as a default implementation.
2021-02-24 14:11:49 -07:00
bjorn fb1447503b Fix gcc warnings; 2021-02-19 23:44:23 -07:00
mcc ffa63e9912 Allow the creation of a (potentially infinite-length) Sound created by a dynamically run callback 2021-02-19 21:30:16 -07:00
bjorn 36170678f0 Sound: Change channel count to channel layout; 2021-02-18 21:17:25 -07:00
bjorn 023067ec27 util.h no longer uses atomics; 2021-02-11 16:37:55 -07:00
bjorn dca79f83f0 SoundData is now named Sound!; 2021-02-08 19:52:56 -07:00