diff --git a/src/sdl2/audio.rs b/src/sdl2/audio.rs index 27bd2638..24903915 100644 --- a/src/sdl2/audio.rs +++ b/src/sdl2/audio.rs @@ -561,6 +561,7 @@ impl AudioQueue { pub struct AudioDevice { subsystem: AudioSubsystem, device_id: AudioDeviceID, + spec: AudioSpec, /// Store the callback to keep it alive for the entire duration of `AudioDevice`. userdata: Box } @@ -608,7 +609,8 @@ impl AudioDevice { Ok(AudioDevice { subsystem: a.clone(), device_id: device_id, - userdata: userdata + userdata: userdata, + spec: spec, }) } } @@ -618,6 +620,9 @@ impl AudioDevice { #[inline] pub fn subsystem(&self) -> &AudioSubsystem { &self.subsystem } + #[inline] + pub fn spec(&self) -> &AudioSpec { &self.spec } + pub fn status(&self) -> AudioStatus { unsafe { let status = ll::SDL_GetAudioDeviceStatus(self.device_id.id());