carb::audio::millisecondsToFrames

Defined in carb/audio/AudioUtils.h

inline size_t carb::audio::millisecondsToFrames(size_t timeInMilliseconds, const SoundFormat *format)

converts a time in milliseconds to a frame count.

Parameters
  • timeInMilliseconds[in] the time in milliseconds 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 milliseconds at the requested frame rate. Note that if the time isn’t exactly divisible by the frame rate, a partial frame may be truncated.