[][src]Struct aaudio::AAudioStreamInfo

pub struct AAudioStreamInfo { /* fields omitted */ }

Passed as a callback parameter, providing operations that are safe to perform from callback invocation.

Implementations

impl AAudioStreamInfo[src]

pub fn get_sample_rate(&self) -> i32[src]

Returns the actual sample rate.

Available since API level 26.

pub fn get_channel_count(&self) -> i32[src]

A stream has one or more channels of data. A frame will contain one sample for each channel.

Available since API level 26.

pub fn get_buffer_size_in_frames(&self) -> i32[src]

Query the maximum number of frames that can be filled without blocking.

Available since API level 26.

pub fn get_frames_per_burst(&self) -> i32[src]

Query the number of frames that the application should read or write at one time for optimal performance. It is OK if an application writes a different number of frames. But the buffer size may need to be larger in order to avoid underruns or overruns.

Note that this may or may not match the actual device burst size. For some endpoints, the burst size can vary dynamically. But these tend to be devices with high latency.

Available since API level 26.

pub fn get_buffer_capacity_in_frames(&self) -> i32[src]

Query maximum buffer capacity in frames.

Available since API level 26.

pub fn get_frames_per_data_callback(&self) -> i32[src]

Query the size of the buffer that will be passed to the dataProc callback in the numFrames parameter.

This call can be used if the application needs to know the value of numFrames before the stream is started. This is not normally necessary.

If a specific size was requested by calling AAudioStreamBuilder::set_frames_per_data_callback() then this will be the same size.

If AAudioStreamBuilder::set_frames_per_data_callback() was not called then this will return the size chosen by AAudio, or 0.

0 indicates that the callback buffer size for this stream may vary from one dataProc callback to the next.

Available since API level 26.

pub fn get_x_run_count(&self) -> i32[src]

An XRun is an Underrun or an Overrun. During playing, an underrun will occur if the stream is not written in time and the system runs out of valid data. During recording, an overrun will occur if the stream is not read in time and there is no place to put the incoming data so it is discarded.

An underrun or overrun can cause an audible "pop" or "glitch".

Note that some INPUT devices may not support this function. In that case a 0 will always be returned.

Available since API level 26.

pub fn get_device_id(&self) -> i32[src]

Returns the actual device ID.

Available since API level 26.

pub fn get_format(&self) -> Format[src]

Returns the actual data format.

Available since API level 26.

pub fn get_sharing_mode(&self) -> SharingMode[src]

Provide actual sharing mode.

Available since API level 26.

pub fn get_performance_mode(&self) -> PerformanceMode[src]

Get the performance mode used by the stream.

Available since API level 26.

pub fn get_direction(&self) -> Direction[src]

Available since API level 26.

pub fn get_frames_written(&self) -> i64[src]

Returns the number of frames that have been written since the stream was created. For an output stream, this will be advanced by the application calling write() or by a data callback. For an input stream, this will be advanced by the endpoint.

The frame position is monotonically increasing.

Available since API level 26.

pub fn get_frames_read(&self) -> i64[src]

Returns the number of frames that have been read since the stream was created. For an output stream, this will be advanced by the endpoint. For an input stream, this will be advanced by the application calling read() or by a data callback.

The frame position is monotonically increasing.

Available since API level 26.

pub fn get_session_id(&self) -> i32[src]

Passes back the session ID associated with this stream.

The session ID can be used to associate a stream with effects processors. The effects are controlled using the Android AudioEffect Java API.

If AAudioStreamBuilder::set_session_id() was called with 0 then a new session ID should be allocated once when the stream is opened.

If AAudioStreamBuilder::set_session_id() was called with a previously allocated session ID then that value should be returned.

If AAudioStreamBuilder::set_session_id() was not called then this function should return -1.

The sessionID for a stream should not change once the stream has been opened.

Available since API level 28.

pub fn get_timestamp_monotonic(&self) -> Result<Timestamp, Error>[src]

Returns the time at which a particular frame was presented. This can be used to synchronize audio with video or MIDI. It can also be used to align a recorded stream with a playback stream.

Timestamps are only valid when the stream is in Started state. InvalidState will be returned if the stream is not started. Note that because request_start() is asynchronous, timestamps will not be valid until a short time after calling request_start(). So InvalidState should not be considered a fatal error. Just try calling again later.

If an error occurs, then the position and time will not be modified.

The position and time passed back are monotonically increasing.

Available since API level 26.

pub fn get_state(&self) -> StreamState[src]

Query the current state of the client, eg. Pausing.

This function will immediately return the state without updating the state. If you want to update the client state based on the server state then call AAudioStream::wait_for_state_change() with currentState set to Unknown and a zero timeout.

Available since API level 26.

Trait Implementations

Auto Trait Implementations

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, 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.