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

◆ read_all()

std::vector< Kakshya::DataVariant > MayaFlux::IO::SoundFileReader::read_all ( )
overridevirtual

Read the entire audio file into memory.

Returns
DataVariant containing audio data as std::vector<double>.

Implements MayaFlux::IO::FileReader.

Definition at line 500 of file SoundFileReader.cpp.

501{
502 std::shared_lock<std::shared_mutex> lock(m_context_mutex);
503
504 if (!m_context || !m_context->is_valid()) {
505 set_error("File not open");
506 return {};
507 }
508
509 auto ctx = m_context;
510 lock.unlock();
511
512 return read_frames(ctx->total_frames, 0);
513}
void set_error(const std::string &error) const
Set the last error message.
std::vector< Kakshya::DataVariant > read_frames(uint64_t num_frames, uint64_t offset=0)
Read a specific number of frames from the file.
std::shared_ptr< FFmpegContext > m_context

References m_context, m_context_mutex, read_frames(), and set_error().

Referenced by load_into_container().

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