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

◆ fill_audio_from_interleaved()

void MayaFlux::Buffers::BufferSupplyMixing::fill_audio_from_interleaved ( const double *  interleaved_data,
uint32_t  num_frames,
ProcessingToken  token,
uint32_t  num_channels 
)

Fills audio token channels from interleaved source data.

Parameters
interleaved_dataSource interleaved data buffer
num_framesNumber of frames to process
tokenProcessing domain
num_channelsNumber of channels in the interleaved data

Takes interleaved data (like typical audio file format or hardware I/O) and distributes it to the token's channels.

Definition at line 95 of file BufferSupplyMixing.cpp.

100{
102 return;
103 }
104
106 uint32_t channels_to_process = std::min(num_channels, unit.channel_count);
107
108 for (uint32_t channel = 0; channel < channels_to_process; ++channel) {
109 auto& buffer_data = unit.get_buffer(channel)->get_data();
110 uint32_t frames_to_copy = std::min(num_frames, static_cast<uint32_t>(buffer_data.size()));
111
112 for (uint32_t frame = 0; frame < frames_to_copy; ++frame) {
113 buffer_data[frame] = interleaved_data[frame * num_channels + channel];
114 }
115 }
116}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
TokenUnitManager & m_unit_manager
Reference to the token/unit manager.
bool has_audio_unit(ProcessingToken token) const
Checks if an audio unit exists for the given token.
RootAudioUnit & get_audio_unit_mutable(ProcessingToken token)
Gets an existing audio unit without creating if missing (mutable)

References MayaFlux::Buffers::TokenUnitManager::get_audio_unit_mutable(), MayaFlux::Buffers::TokenUnitManager::has_audio_unit(), m_unit_manager, and token.

+ Here is the call graph for this function: