pub struct AudioQueue<Channel: AudioFormatNum> { /* private fields */ }Expand description
Wraps SDL_AudioDeviceID and owns the callback data used by the audio device.
Implementations§
Source§impl<'a, Channel: AudioFormatNum> AudioQueue<Channel>
impl<'a, Channel: AudioFormatNum> AudioQueue<Channel>
Sourcepub fn open_queue<D: Into<Option<&'a str>>>(
a: &AudioSubsystem,
device: D,
spec: &AudioSpecDesired,
) -> Result<AudioQueue<Channel>, String>
pub fn open_queue<D: Into<Option<&'a str>>>( a: &AudioSubsystem, device: D, spec: &AudioSpecDesired, ) -> Result<AudioQueue<Channel>, String>
Opens a new audio device given the desired parameters and callback.
pub fn subsystem(&self) -> &AudioSubsystem
pub fn spec(&self) -> &AudioSpec
pub fn status(&self) -> AudioStatus
Sourcepub fn queue(&self, data: &[Channel]) -> bool
👎Deprecated since 0.35.2: Users should instead use AudioQueue::queue_audio
pub fn queue(&self, data: &[Channel]) -> bool
Adds data to the audio queue.
Sourcepub fn queue_audio(&self, data: &[Channel]) -> Result<(), String>
pub fn queue_audio(&self, data: &[Channel]) -> Result<(), String>
Adds data to the audio queue.
pub fn size(&self) -> u32
Auto Trait Implementations§
impl<Channel> Freeze for AudioQueue<Channel>
impl<Channel> RefUnwindSafe for AudioQueue<Channel>where
Channel: RefUnwindSafe,
impl<Channel> !Send for AudioQueue<Channel>
impl<Channel> !Sync for AudioQueue<Channel>
impl<Channel> Unpin for AudioQueue<Channel>where
Channel: Unpin,
impl<Channel> UnwindSafe for AudioQueue<Channel>where
Channel: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more