carb::audio::microsecondsToBytes

Defined in carb/audio/AudioUtils.h

inline size_t carb::audio::microsecondsToBytes(size_t timeInMicroseconds, const SoundFormat *format)

converts a time in microseconds to a byte count.

Parameters
  • timeInMicroseconds[in] the time in microseconds to be converted to a frame count.

  • format[in] the format information block for the sound data this time is being converted for.

Returns

the approximate number of bytes of audio data required to fill the requested number of microseconds. Note that this will not be an exact value because the data format may not divide evenly into the requested number of microseconds.