ipatix/wav2agb

Sampling Rate is Truncated to 16 bits

Closed this issue · 1 comments

In wav_file.cpp,

static uint16_t arr_u32(const std::vector<uint8_t>& arr, size_t pos)
{
    uint16_t val = uint16_t(arr.at(pos) | (arr.at(pos + 1) << 8) |
            (arr.at(pos + 2) << 16) | (arr.at(pos + 3) << 24));
    return val;
}

should be

static uint32_t arr_u32(const std::vector<uint8_t>& arr, size_t pos)
{
    uint32_t val = uint32_t(arr.at(pos) | (arr.at(pos + 1) << 8) |
            (arr.at(pos + 2) << 16) | (arr.at(pos + 3) << 24));
    return val;
}

Fixed in 3acb19c.

Thank you very much for the bug report!