carb::audio::millisecondsToBytes

Defined in carb/audio/AudioUtils.h

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

converts a time in milliseconds to a byte 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 approximate number of bytes of audio data required to fill the requested number of milliseconds. Note that this will not be an exact value because the data format may not divide evenly into the requested number of milliseconds.