Wires MixerState into mix_sounds (group × master volume applied per sound)
and exposes SetGroupVolume/FadeGroup commands through AudioSystem.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add Play3d and SetListener variants to AudioCommand, expose play_3d
and set_listener methods on AudioSystem, initialize a Listener in
the Windows audio thread, and handle the new commands in the match.
Update mix_sounds call to pass the listener.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add SpatialParams field to PlayingSound, new_3d constructor, and
listener parameter to mix_sounds. Compute per-channel attenuation
and stereo panning when spatial params are present; 2D sounds are
unchanged. Add three new tests: spatial_2d_unchanged,
spatial_far_away_silent, and spatial_right_panning.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces AudioCommand enum (Play, Stop, SetVolume, StopAll, Shutdown)
and AudioSystem that spawns a dedicated audio thread. On Windows the
thread drives WasapiDevice with a 5ms mix-and-write loop; on other
platforms it runs in silent null mode. lib.rs exports wasapi (windows)
and audio_system modules with AudioSystem re-exported at crate root.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements COM vtable structs for IMMDeviceEnumerator, IMMDevice,
IAudioClient, and IAudioRenderClient with correct IUnknown base layout.
WasapiDevice handles COM init, default endpoint activation, mix format
detection (float/i16), shared-mode Initialize (50ms buffer), and
write_samples with GetCurrentPadding/GetBuffer/ReleaseBuffer.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>