|
nngn
|
A non-owning wrapper for a byte buffer containing a WAV file. More...
#include <wav.h>
Classes | |
| struct | segment |
Public Member Functions | |
| WAV (void)=default | |
| Constructs an empty object, must be initialized before it is used. | |
| constexpr | WAV (std::span< std::byte > buffer) |
| constexpr u32 | fmt_size (void) const |
| constexpr u16 | format (void) const |
| constexpr u16 | channels (void) const |
| constexpr u32 | rate (void) const |
| constexpr u16 | bits_per_sample (void) const |
| constexpr std::size_t | n_samples (void) const |
| constexpr void | set_size (u32 s) const |
| constexpr void | set_channels (u16 c) const |
| constexpr void | set_rate (u32 r) const |
| constexpr void | fill (void) const |
| constexpr std::span< std::byte > | data (void) const |
| bool | check (void) const |
Static Public Attributes | |
| static constexpr std::size_t | HEADER_SIZE = 44 |
Private Types | |
| enum class | offset : std::size_t { RIFF_SEG = 0 , SEG_SIZE = 4 , WAVE_SEG = 8 , FMT_SEG = 12 , FMT_SIZE = 16 , FORMAT = 20 , CHANNELS = 22 , RATE = 24 , BYTES_PER_SEC = 28 , BLOCK_ALIGN = 32 , BITS_PER_SAMPLE = 34 , DATA_SEG = 36 , DATA_SIZE = 40 , DATA = HEADER_SIZE } |
Private Member Functions | |
| constexpr std::span< std::byte > | subspan (offset o, std::size_t n) const |
| template<typename T > | |
| constexpr T | read (offset o) const |
| template<typename T > | |
| constexpr void | write (offset o, const T &x) const |
| constexpr std::size_t | size (void) const |
Private Attributes | |
| std::span< std::byte > | b = {} |
A non-owning wrapper for a byte buffer containing a WAV file.
|
strongprivate |
|
default |
Constructs an empty object, must be initialized before it is used.
|
inlineexplicitconstexpr |
|
inlineconstexpr |


|
inlineconstexpr |


| bool nngn::WAV::check | ( | void | ) | const |

|
inlineconstexpr |


|
inlineconstexpr |

|
inlineconstexpr |


|
inlineconstexpr |


|
inlineconstexpr |

|
inlineconstexpr |




|
inlineconstexpr |

|
inlineconstexpr |

|
inlineconstexpr |


|
inlineconstexprprivate |


|
inlineconstexprprivate |



|
private |
|
staticconstexpr |