museumsvictoria / spatial_audio_server

An audio backend for the multi-layered soundscape of Beyond Perception: Seeing the Unseen, a permanent exhibition at Scienceworks in Melbourne, Australia.
81 stars 14 forks source link

Fix bug where sounds would glitch if they panned too quickly #163

Closed mitchmindtree closed 6 years ago

mitchmindtree commented 6 years ago

Previously the gain for each speaker for each channel in each sound was only re-calculated once per buffer. This meant that if a sound was moving fast enough over the duration of an audio buffer to cause a significant change in DBAP gain, a clipping effect could occur.

This commit fixes this by ensuring that the buffer linearly interpolates the gain from the gain at the end of the previous buffer to the newly calculated gain.

Closes #155.