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

◆ write_to()

void MayaFlux::Buffers::InputAudioBuffer::write_to ( std::shared_ptr< AudioBuffer buffer)

Writes buffer data to a specific listener buffer.

Parameters
bufferTarget buffer to write to

Definition at line 10 of file InputAudioBuffer.cpp.

11{
12 if (!buffer) {
13 std::cerr << "InputAudioBuffer: Attempted to write to null buffer" << std::endl;
14 return;
15 }
16
17 const auto& src_data = get_data();
18 auto& dst_data = buffer->get_data();
19
20 if (dst_data.size() != src_data.size()) {
21 dst_data.resize(src_data.size());
22 }
23
24 std::copy(src_data.begin(), src_data.end(), dst_data.begin());
25}
virtual std::vector< double > & get_data()
Gets mutable access to the buffer's underlying audio data.

References MayaFlux::Buffers::AudioBuffer::get_data().

+ Here is the call graph for this function: