29 BufferStreamReadOnly stream{xwvData};
33 const auto dataLength = stream.read<uint32_t>();
34 const auto dataOffset = stream.read<uint32_t>();
35 this->
audioData = stream.at_bytes(dataLength, dataOffset);
39 if (
const auto valveDataLength = stream.read<uint16_t>()) {
40 this->
valveData = stream.at_bytes(valveDataLength,
sizeof(uint32_t) * 3 +
sizeof(int32_t) +
sizeof(uint8_t) * 4);
45 const auto packed = stream.read<uint8_t>();
60 this->
decodedSampleCount = ::xmaBytesToSamples(this->audioData.size(), this->channelCount);
65 const auto headerSize = stream.read<uint32_t>();
66 if (headerSize !=
sizeof(uint32_t) * 4 +
sizeof(int32_t) +
sizeof(uint16_t) +
sizeof(uint8_t) * 4) {
70 const auto dataLength = stream.read<uint32_t>();
71 const auto dataOffset = stream.read<uint32_t>();
72 this->
audioData = stream.at_bytes(dataLength, dataOffset);
76 if (
const auto valveDataLength = stream.read<uint16_t>()) {
77 this->
valveData = stream.at_bytes(valveDataLength, headerSize);
82 const auto packed = stream.read<uint8_t>();
95 this->
decodedSampleCount = ::xmaBytesToSamples(this->audioData.size(), this->channelCount);
100 stream.set_big_endian(
true);
101 if (stream.read<uint32_t>() != 4) {
105 const auto headerSize = stream.read<uint32_t>();
106 if (headerSize !=
sizeof(uint32_t) * 7 +
sizeof(int32_t) +
sizeof(uint16_t) * 4 +
sizeof(uint8_t) * 8) {
110 const auto staticDataSize = stream.read<uint32_t>();
111 this->
staticData = stream.at_bytes(staticDataSize, headerSize);
113 const auto dataOffset = stream.read<uint32_t>();
114 const auto dataLength = stream.read<uint32_t>();
115 this->
audioData = stream.at_bytes(dataLength, dataOffset);
119 if (
const auto valveDataLength = stream.read<uint16_t>()) {
120 this->
valveData = stream.at_bytes(valveDataLength, headerSize);
131 if (stream.read<uint8_t>()) {
132 this->
seekTable = stream.read_bytes(this->audioData.size() *
sizeof(uint32_t) / 2048);