ambisonic
Compose and play 3D audio.
The library provides 3D sound scene support on top of rodio
.
It allows positioning and moving sound sources freely in 3D space around a virtual listener,
and playing the resulting spatial mix in real-time over a sound card.
ambisonic
is built around the concept of an intermediate representation of the sound field,
called B-format. The B-format describes what the listener should hear, independent of
their audio playback equipment. This leads to a clear separation of audio scene composition and
rendering. For details, see Wikipedia.
In its current state, the library allows spatial composition of single-channel rodio
sources
into a first-order B-format stream. That stream is rendered to a two-channel stereo signal,
and played through a rodio
sink. Although at the moment only stereo output is supported, the
B-format abstraction should make it easy to implement arbitrary speaker configurations in the
future.
Usage Example
use sleep;
use Duration;
use ;
let scene = default.build;
let source = new;
let mut sound = scene.play;
// exaggerate doppler effect
sound.set_doppler_factor;
// move sound from right to left
sound.set_velocity;
for i in 0..1000
sound.set_velocity;