MCPcopy Create free account
hub / github.com/cactus-compute/cactus / get_all

Method get_all

tests/test_utils.cpp:483–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481}
482
483size_t AudioCapture::get_all(std::vector<float>& result) {
484 std::lock_guard<std::mutex> lock(m_mutex);
485 if (m_audio_len == 0) return 0;
486
487 result.resize(m_audio_len);
488 size_t start_pos = (m_audio_pos + m_audio.size() - m_audio_len) % m_audio.size();
489 for (size_t i = 0; i < m_audio_len; i++)
490 result[i] = m_audio[(start_pos + i) % m_audio.size()];
491
492 size_t n_samples = m_audio_len;
493 m_audio_len = 0;
494 return n_samples;
495}
496
497size_t AudioCapture::get_buffer_length() const {
498 std::lock_guard<std::mutex> lock(m_mutex);

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected