[go: up one dir, main page]

Struct AudioQueue

Source
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>

Source

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.

Source

pub fn subsystem(&self) -> &AudioSubsystem

Source

pub fn spec(&self) -> &AudioSpec

Source

pub fn status(&self) -> AudioStatus

Source

pub fn pause(&self)

Pauses playback of the audio device.

Source

pub fn resume(&self)

Starts playback of the audio device.

Source

pub fn queue(&self, data: &[Channel]) -> bool

👎Deprecated since 0.35.2: Users should instead use AudioQueue::queue_audio

Adds data to the audio queue.

Source

pub fn queue_audio(&self, data: &[Channel]) -> Result<(), String>

Adds data to the audio queue.

Source

pub fn size(&self) -> u32

Source

pub fn clear(&self)

Clears all data from the current audio queue.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.