The audio device was disconnected. This could occur, for example, when headphones
are plugged in or unplugged. The stream cannot be used after the device is disconnected.
Applications should stop and close the stream.
If this error is received in an error callback then another thread should be
used to stop and close the stream.
This is used to represent a value that has not been specified.
For example, an application could use UNSPECIFIED to indicate
that is did not not care what the specific value of a parameter was
and would accept whatever it was given.
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.
Passes back 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.
Passes back 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.
Passes back 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.
Returns 0 for OK or a negative error.
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.
Free the audio resources associated with a stream created by
AAudioStreamBuilder_openStream().
AAudioStream_close() should be called at some point after calling
this function.
Asynchronous request for the stream to flush.
Flushing will discard any pending data.
This call only works if the stream is pausing or paused.
Frame counters are not reset by a flush. They may be advanced.
After this call the state will be in Flushing or Flushed.
Asynchronous request for the stream to pause.
Pausing a stream will freeze the data flow but not flush any buffers.
Use AAudioStream_requestStart() to resume playback after a pause.
After this call the state will be in Pausing or
Paused.
Asynchronously request to start playing the stream. For output streams, one should
write to the stream to fill the buffer before starting.
Otherwise it will underflow.
After this call the state will be in Starting or Started.
Asynchronous request for the stream to stop.
The stream will stop after all of the data currently buffered has been played.
After this call the state will be in Stopping or Stopped.
This can be used to adjust the latency of the buffer by changing
the threshold where blocking will occur.
By combining this with AAudioStream_getXRunCount(), the latency can be tuned
at run-time for each device.
Returns actual buffer size in frames or a negative error.