carb::audio::microsecondsToFrames

Defined in carb/audio/AudioUtils.h

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

converts a time in microseconds to a frame 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 minimum number of frames required to cover the requested number of microseconds at the requested frame rate. Note that if the time isn’t exactly divisible by the frame rate, a partial frame may be truncated.