Defined in carb/audio/AudioUtils.h

constexpr size_t carb::audio::bytesToMicroseconds(size_t bytes, size_t frameRate, size_t channels, size_t bps)

converts a byte count to an approximate time in microseconds.

  • 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.

  • frameRate[in] the frame rate of the audio that needs a time calculated.

  • channels[in] the number of channels in the audio data format.

  • bps[in] the number of bits per sample of audio data. This must be 8, 16, 24, or

    1. This does not properly handle byte offset calculations for compressed audio formats.


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