Struct sdl2::audio::AudioDevice [] [src]

pub struct AudioDevice<CB: AudioCallback> { /* fields omitted */ }

Wraps SDL_AudioDeviceID and owns the callback data used by the audio device.

Methods

impl<CB: AudioCallback> AudioDevice<CB>
[src]

[src]

Opens a new audio device for playback (given the desired parameters and callback).

[src]

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

[src]

[src]

[src]

[src]

Pauses playback of the audio device.

[src]

Starts playback of the audio device.

[src]

Locks the audio device using SDL_LockAudioDevice.

When the returned lock guard is dropped, SDL_UnlockAudioDevice is called. Use this method to read and mutate callback data.

[src]

Closes the audio device and saves the callback data from being dropped.

Note that simply dropping AudioDevice will close the audio device, but the callback data will be dropped.