MayaFlux 1.0.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 787 of file SoundStreamContainer.cpp.

788{
789 if (!m_double_extraction_dirty.load(std::memory_order_acquire))
790 return { m_cached_ext_buffer };
791
793 if (m_data.empty())
794 return {};
795
796 std::span<const double> result;
798 auto span = convert_variant<double>(m_data[0]);
799 result = { span.data(), span.size() };
800 });
801 return result;
802 }
803
804 const auto& spans = get_span_cache();
805
806 auto channels = spans
807 | std::views::transform([](const auto& span) {
808 return std::vector<double>(span.begin(), span.end());
809 })
810 | std::ranges::to<std::vector>();
811
813 m_double_extraction_dirty.store(false, std::memory_order_release);
814
815 return { m_cached_ext_buffer };
816}
uint32_t channels
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:268

References channels, 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: