carb::audio::alignBytesToFrameCeil
Defined in carb/audio/AudioUtils.h
-
inline size_t carb::audio::alignBytesToFrameCeil(size_t bytes, size_t channels, SampleFormat format)
aligns a byte count to a frame boundary for an audio data format.
- Parameters
bytes – [in] the byte count to align to a frame boundary. This will be aligned to the next higher frame boundary if it is not already aligned.
channels – [in] the number of channels in the audio data format.
format – [in] the sample format of the data. This must be a PCM sample format.
- Returns
the requested byte count aligned to the next frame boundary if it is not already aligned.
- Returns
the requested byte count unmodified if it is already aligned to a frame boundary.