[][src]Struct sdl2::AudioSubsystem

pub struct AudioSubsystem { /* fields omitted */ }

Methods

impl AudioSubsystem[src]

pub fn sdl(&self) -> Sdl[src]

Obtain an SDL context.

impl AudioSubsystem[src]

pub fn open_playback<'a, CB, F, D>(
    &self,
    device: D,
    spec: &AudioSpecDesired,
    get_callback: F
) -> Result<AudioDevice<CB>, String> where
    CB: AudioCallback,
    F: FnOnce(AudioSpec) -> CB,
    D: Into<Option<&'a str>>, 
[src]

Opens a new audio device given the desired parameters and callback.

If you want to modify the callback-owned data at a later point (for example to update its data buffer) you're likely to be interested in the AudioDevice.lock method.

pub fn open_capture<'a, CB, F, D>(
    &self,
    device: D,
    spec: &AudioSpecDesired,
    get_callback: F
) -> Result<AudioDevice<CB>, String> where
    CB: AudioCallback,
    F: FnOnce(AudioSpec) -> CB,
    D: Into<Option<&'a str>>, 
[src]

Opens a new audio device for capture (given the desired parameters and callback). Supported since SDL 2.0.5

If you want to modify the callback-owned data at a later point (for example to update its data buffer) you're likely to be interested in the AudioDevice.lock method.

pub fn open_queue<'a, Channel, D>(
    &self,
    device: D,
    spec: &AudioSpecDesired
) -> Result<AudioQueue<Channel>, String> where
    Channel: AudioFormatNum,
    D: Into<Option<&'a str>>, 
[src]

Opens a new audio device which uses queueing rather than older callback method.

pub fn current_audio_driver(&self) -> &'static str[src]

pub fn num_audio_playback_devices(&self) -> Option<u32>[src]

pub fn audio_playback_device_name(&self, index: u32) -> Result<String, String>[src]

Trait Implementations

impl Clone for AudioSubsystem[src]

impl Debug for AudioSubsystem[src]

Auto Trait Implementations

impl !RefUnwindSafe for AudioSubsystem

impl !Send for AudioSubsystem

impl !Sync for AudioSubsystem

impl Unpin for AudioSubsystem

impl !UnwindSafe for AudioSubsystem

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.