SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
WAV.cpp
Go to the documentation of this file.
1
#include <
sndpp/WAV.h
>
2
3
using namespace
sndpp
;
4
5
WAV::WAV
(uint32_t
signature
)
6
:
RIFF
{
WAV_TYPE
,
signature
} {}
7
8
WAV::WAV
(std::vector<std::byte>&& wavData)
9
:
RIFF
{wavData,
WAV_TYPE
} {
10
// FMT chunk and DATA chunk are required
11
if
(!this->
hasChunk
(
CHUNK_FMT
) || !this->
hasChunk
(
CHUNK_DATA
)) {
12
this->
signature
= 0;
13
}
14
}
15
16
WAV::WAV
(std::span<const std::byte> wavData)
17
:
RIFF
{wavData,
WAV_TYPE
} {}
18
19
WAV::WAV
(
const
std::filesystem::path& wavPath)
20
:
RIFF
{wavPath,
WAV_TYPE
} {}
WAV.h
sndpp::RIFF::signature
uint32_t signature
Definition
RIFF.h:43
sndpp::RIFF::hasChunk
bool hasChunk(uint32_t chunkType) const
Definition
RIFF.cpp:69
sndpp::RIFF::RIFF
RIFF(uint32_t type, uint32_t signature=RIFF_SIGNATURE)
Definition
RIFF.cpp:11
sndpp::WAV::WAV
WAV(uint32_t signature=RIFF_SIGNATURE)
Definition
WAV.cpp:5
sndpp::WAV::CHUNK_FMT
@ CHUNK_FMT
Definition
WAV.h:17
sndpp::WAV::CHUNK_DATA
@ CHUNK_DATA
Definition
WAV.h:18
sndpp
Definition
RIFF.h:10
sndpp::WAV_TYPE
constexpr auto WAV_TYPE
Definition
WAV.h:12
src
sndpp
WAV.cpp
Generated on
for SourcePP by
1.14.0