MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ NetworkAudioBuffer()

MayaFlux::Buffers::NetworkAudioBuffer::NetworkAudioBuffer ( uint32_t  channel_id,
uint32_t  num_samples,
std::shared_ptr< Nodes::Network::NodeNetwork network,
bool  clear_before_process = true 
)

Creates a buffer connected to a NodeNetwork.

Parameters
channel_idChannel identifier for this buffer
num_samplesBuffer size in samples (should match system buffer size)
networkSource network whose batch output populates this buffer (must be AUDIO_SINK or AUDIO_COMPUTE)
clear_before_processWhether to zero buffer before each cycle

Definition at line 115 of file NetworkAudioBuffer.cpp.

120 : AudioBuffer(channel_id, num_samples)
121 , m_network(std::move(network))
122 , m_clear_before_process(clear_before_process)
123{
124 auto mode = m_network->get_output_mode();
127 error<std::invalid_argument>(
130 std::source_location::current(),
131 "NetworkAudioBuffer requires AUDIO_SINK or AUDIO_COMPUTE network, got mode={}",
132 static_cast<int>(mode));
133 }
134}
AudioBuffer()
Creates a new uninitialized audio buffer.
std::shared_ptr< Nodes::Network::NodeNetwork > m_network
@ Init
Engine/subsystem initialization.
@ Buffers
Buffers, Managers, processors and processing chains.
std::vector< double > mode(std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
Mode per window via tolerance-bucketed frequency count.
Definition Analysis.cpp:559
@ AUDIO_COMPUTE
processed each cycle but not sent to output
@ AUDIO_SINK
Aggregated audio samples sent to output.

References MayaFlux::Nodes::Network::AUDIO_COMPUTE, MayaFlux::Nodes::Network::AUDIO_SINK, MayaFlux::Journal::Buffers, MayaFlux::Journal::Init, and m_network.