DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
AudioSpec.h
Go to the documentation of this file.
1// DSPark -- Professional Audio DSP Framework
2// Copyright (c) 2026 Cristian Moresi -- MIT License
3
4#pragma once
5
22namespace dspark {
23
35{
43 double sampleRate = 0.0;
44
51 int maxBlockSize = 0;
52
56 int numChannels = 0;
57
67 [[nodiscard]] constexpr bool isValid() const noexcept
68 {
69 return sampleRate > 0.0 && maxBlockSize > 0 && numChannels > 0;
70 }
71
80 constexpr bool operator==(const AudioSpec&) const noexcept = default;
81};
82
83} // namespace dspark
Main namespace for the DSPark framework.
Describes the audio environment for a DSP processor.
Definition AudioSpec.h:35
constexpr bool isValid() const noexcept
Checks if the specification contains valid, processable parameters.
Definition AudioSpec.h:67
constexpr bool operator==(const AudioSpec &) const noexcept=default
Default member-wise equality (C++20).
int numChannels
Number of audio channels (e.g., 1 = mono, 2 = stereo).
Definition AudioSpec.h:56
int maxBlockSize
Maximum number of samples per processing block.
Definition AudioSpec.h:51
double sampleRate
Sample rate in Hz.
Definition AudioSpec.h:43