MayaFlux 0.3.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 265 of file SoundFileReader.cpp.

266{
267 std::shared_lock<std::shared_mutex> lock(m_context_mutex);
268 if (!m_demux || !m_audio) {
269 set_error("File not open");
270 return {};
271 }
272 return decode_frames(m_demux, m_audio, m_audio->total_frames, 0);
273}
std::shared_ptr< AudioStreamContext > m_audio
Codec + resampler state.
std::shared_mutex m_context_mutex
Guards both context pointers.
std::vector< Kakshya::DataVariant > decode_frames(const std::shared_ptr< FFmpegDemuxContext > &demux, const std::shared_ptr< AudioStreamContext > &audio, uint64_t num_frames, uint64_t offset)
Decode num_frames PCM frames starting at offset.
void set_error(const std::string &error) const
Set the last error message.
std::shared_ptr< FFmpegDemuxContext > m_demux
Container / format state.

References decode_frames(), m_audio, m_context_mutex, m_demux, and set_error().

Referenced by load_into_container().

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