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

◆ get_data_as_double()

std::span< const double > MayaFlux::Kakshya::SoundStreamContainer::get_data_as_double ( ) const

Get the audio data as a specific type.

Returns
Span of double data for direct access

Definition at line 750 of file SoundStreamContainer.cpp.

751{
752 if (!m_double_extraction_dirty.load(std::memory_order_acquire))
753 return { m_cached_ext_buffer };
754
756 if (m_data.empty())
757 return {};
758
759 std::span<const double> result;
761 auto span = convert_variant<double>(m_data[0]);
762 result = { span.data(), span.size() };
763 });
764 return result;
765 }
766
767 const auto& spans = get_span_cache();
768
769 auto channels = spans
770 | std::views::transform([](const auto& span) {
771 return std::vector<double>(span.begin(), span.end());
772 })
773 | std::ranges::to<std::vector>();
774
776 m_double_extraction_dirty.store(false, std::memory_order_release);
777
778 return { m_cached_ext_buffer };
779}
const std::vector< std::span< double > > & get_span_cache() const
Get the cached spans for each channel, recomputing if dirty.
@ INTERLEAVED
Single DataVariant with interleaved data (LRLRLR for stereo)
std::vector< T > interleave_channels(const std::vector< std::vector< T > > &channels)
Interleave multiple channels of data into a single vector.
bool seqlock_read_void(const Seqlock &lock, uint32_t max_attempts, Fn &&fn)
Invoke a void read functor under a Seqlock with a bounded retry count.
Definition SeqLock.hpp:222

References get_span_cache(), MayaFlux::Kakshya::interleave_channels(), MayaFlux::Kakshya::INTERLEAVED, m_cached_ext_buffer, m_data, m_data_lock, m_double_extraction_dirty, m_structure, and MayaFlux::Kakshya::ContainerDataStructure::organization.

Referenced by get_frames_typed(), get_raw_data(), and peek_sequential().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: