#include "Utility.h"

std::vector<uint8_t> duplicate(const uint8_t *data, int32_t byteSize) {
    std::vector<uint8_t> ret(byteSize * 2);
    auto pcm = reinterpret_cast<const uint16_t *>(data);
    auto retPcm = reinterpret_cast<uint16_t *>(ret.data());
    for (int i = 0; i < byteSize / 2; i++) {
        retPcm[2 * i] = pcm[i];
        retPcm[2 * i + 1] = pcm[i];
    }
    return ret;
}