carb::audio::bytesToMicroseconds

Defined in carb/audio/AudioUtils.h

inline size_t carb::audio::bytesToMicroseconds(size_t bytes, const SoundFormat *format)

converts a byte count to an approximate time in microseconds.

Parameters
  • bytes[in] the number of bytes to be converted to a time in microseconds. Note that this byte count is expected to be frame aligned.

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

Returns

the approximate number of microseconds of audio data that the requested byte count represents for the given format.