Validate the container's structure and output configuration.
Throws if configuration is invalid.
69{
71 std::cerr << "Warning: Container has no data elements" << '\n';
72 }
73
75 throw std::runtime_error("Audio output shape must be [frames, channels]");
76 }
77
81
82 if (frames_requested == 0 || channels_requested == 0) {
83 throw std::runtime_error("Frame and channel counts cannot be zero");
84 }
85
87 throw std::runtime_error("Requested frame count exceeds available samples per channel");
88 }
89
90 if (channels_requested > available_channels) {
91 throw std::runtime_error(
92 "Requested " + std::to_string(channels_requested) + " channels exceeds available " + std::to_string(available_channels) + " channels");
93 }
94
97 << " doesn't match channel count " << available_channels << ", adjusting\n";
99 }
100
101 std::cout << "Audio processor: "
103 << " layout, processing " << frames_requested << "×" << channels_requested
105}
std::vector< uint64_t > m_output_shape
uint64_t m_total_elements
ContainerDataStructure m_structure
std::vector< uint64_t > m_current_position
@ INTERLEAVED
Single DataVariant with interleaved data (LRLRLR for stereo)
static uint64_t get_channel_count(const std::vector< DataDimension > &dimensions)
Extract channel count from dimensions.
OrganizationStrategy organization
static uint64_t get_samples_count_per_channel(const std::vector< DataDimension > &dimensions)
Get samples per channel (time dimension only).