Call this function when you are ready to begin reading from the device
buffer.
* instream - (in) The input stream you want to read from.
* areas - (out) The memory addresses you can read data from. It is OK
to modify the pointers if that helps you iterate. There might be a "hole"
in the buffer. To indicate this, areas will be NULL and frame_count
tells how big the hole is in frames.
* frame_count - (in/out) - Provide the number of frames you want to read;
returns the number of frames you can actually read. The returned value
will always be less than or equal to the provided value. If the provided
value is less than frame_count_min from SoundIoInStream::read_callback this function
returns with #SoundIoErrorInvalid.
It is your responsibility to call this function no more and no fewer than the
correct number of times according to the frame_count_min and
frame_count_max criteria from SoundIoInStream::read_callback.
You must call this function only from the SoundIoInStream::read_callback thread context.
After calling this function, read data from areas and then use
::soundio_instream_end_read` to actually remove the data from the buffer
and move the read index forward. ::soundio_instream_end_read should not be
called if the buffer is empty (frame_count == 0), but it should be called
if there is a hole.
Possible errors:
* #SoundIoErrorInvalid
* *frame_count < frame_count_min or *frame_count > frame_count_max
* #SoundIoErrorStreaming
* #SoundIoErrorIncompatibleDevice - in rare cases it might just now
be discovered that the device uses non-byte-aligned access, in which
case this error code is returned.
Call this function when you are ready to begin reading from the device buffer. * instream - (in) The input stream you want to read from. * areas - (out) The memory addresses you can read data from. It is OK to modify the pointers if that helps you iterate. There might be a "hole" in the buffer. To indicate this, areas will be NULL and frame_count tells how big the hole is in frames. * frame_count - (in/out) - Provide the number of frames you want to read; returns the number of frames you can actually read. The returned value will always be less than or equal to the provided value. If the provided value is less than frame_count_min from SoundIoInStream::read_callback this function returns with #SoundIoErrorInvalid. It is your responsibility to call this function no more and no fewer than the correct number of times according to the frame_count_min and frame_count_max criteria from SoundIoInStream::read_callback. You must call this function only from the SoundIoInStream::read_callback thread context. After calling this function, read data from areas and then use ::soundio_instream_end_read` to actually remove the data from the buffer and move the read index forward. ::soundio_instream_end_read should not be called if the buffer is empty (frame_count == 0), but it should be called if there is a hole.
Possible errors: * #SoundIoErrorInvalid * *frame_count < frame_count_min or *frame_count > frame_count_max * #SoundIoErrorStreaming * #SoundIoErrorIncompatibleDevice - in rare cases it might just now be discovered that the device uses non-byte-aligned access, in which case this error code is returned.