Call this function when you are ready to begin writing to the device buffer.
* outstream - (in) The output stream you want to write to.
* areas - (out) The memory addresses you can write data to, one per
channel. It is OK to modify the pointers if that helps you iterate.
* frame_count - (in/out) Provide the number of frames you want to write.
Returned will be the number of frames you can actually write, which is
also the number of frames that will be written when you call
::soundio_outstream_end_write. The value returned will always be less
than or equal to the value provided.
It is your responsibility to call this function exactly as many times as
necessary to meet the frame_count_min and frame_count_max criteria from
SoundIoOutStream::write_callback.
You must call this function only from the SoundIoOutStream::write_callback thread context.
After calling this function, write data to areas and then call
::soundio_outstream_end_write.
If this function returns an error, do not call ::soundio_outstream_end_write.
Possible errors:
* #SoundIoErrorInvalid
* *frame_count <= 0
* *frame_count < frame_count_min or *frame_count > frame_count_max
* function called too many times without respecting frame_count_max
* #SoundIoErrorStreaming
* #SoundIoErrorUnderflow - an underflow caused this call to fail. You might
also get a SoundIoOutStream::underflow_callback, and you might not get
this error code when an underflow occurs. Unlike #SoundIoErrorStreaming,
the outstream is still in a valid state and streaming can continue.
* #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 writing to the device buffer. * outstream - (in) The output stream you want to write to. * areas - (out) The memory addresses you can write data to, one per channel. It is OK to modify the pointers if that helps you iterate. * frame_count - (in/out) Provide the number of frames you want to write. Returned will be the number of frames you can actually write, which is also the number of frames that will be written when you call ::soundio_outstream_end_write. The value returned will always be less than or equal to the value provided. It is your responsibility to call this function exactly as many times as necessary to meet the frame_count_min and frame_count_max criteria from SoundIoOutStream::write_callback. You must call this function only from the SoundIoOutStream::write_callback thread context. After calling this function, write data to areas and then call ::soundio_outstream_end_write. If this function returns an error, do not call ::soundio_outstream_end_write.
Possible errors: * #SoundIoErrorInvalid * *frame_count <= 0 * *frame_count < frame_count_min or *frame_count > frame_count_max * function called too many times without respecting frame_count_max * #SoundIoErrorStreaming * #SoundIoErrorUnderflow - an underflow caused this call to fail. You might also get a SoundIoOutStream::underflow_callback, and you might not get this error code when an underflow occurs. Unlike #SoundIoErrorStreaming, the outstream is still in a valid state and streaming can continue. * #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.