26 BufferStreamReadOnly stream{xwvData};
30 const auto dataLength = stream.read<uint32_t>();
31 const auto dataOffset = stream.read<uint32_t>();
32 this->
audioData = stream.at_bytes(dataLength, dataOffset);
36 if (
const auto valveDataLength = stream.read<uint16_t>()) {
37 this->
valveData = stream.at_bytes(valveDataLength,
sizeof(uint32_t) * 3 +
sizeof(int32_t) +
sizeof(uint8_t) * 4);
42 const auto packed = stream.read<uint8_t>();
57 this->
decodedSampleCount = ::xmaBytesToSamples(this->audioData.size(), this->channelCount);
62 const auto headerSize = stream.read<uint32_t>();
63 if (headerSize !=
sizeof(uint32_t) * 4 +
sizeof(int32_t) +
sizeof(uint16_t) +
sizeof(uint8_t) * 4) {
67 const auto dataLength = stream.read<uint32_t>();
68 const auto dataOffset = stream.read<uint32_t>();
69 this->
audioData = stream.at_bytes(dataLength, dataOffset);
73 if (
const auto valveDataLength = stream.read<uint16_t>()) {
74 this->
valveData = stream.at_bytes(valveDataLength, headerSize);
79 const auto packed = stream.read<uint8_t>();
92 this->
decodedSampleCount = ::xmaBytesToSamples(this->audioData.size(), this->channelCount);
97 stream.set_big_endian(
true);
98 if (stream.read<uint32_t>() != 4) {
102 const auto headerSize = stream.read<uint32_t>();
103 if (headerSize !=
sizeof(uint32_t) * 7 +
sizeof(int32_t) +
sizeof(uint16_t) * 4 +
sizeof(uint8_t) * 8) {
107 const auto staticDataSize = stream.read<uint32_t>();
108 this->
staticData = stream.at_bytes(staticDataSize, headerSize);
110 const auto dataOffset = stream.read<uint32_t>();
111 const auto dataLength = stream.read<uint32_t>();
112 this->
audioData = stream.at_bytes(dataLength, dataOffset);
116 if (
const auto valveDataLength = stream.read<uint16_t>()) {
117 this->
valveData = stream.at_bytes(valveDataLength, headerSize);
128 if (stream.read<uint8_t>()) {
129 this->
seekTable = stream.read_bytes(this->audioData.size() *
sizeof(uint32_t) / 2048);