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

◆ can_read()

bool MayaFlux::IO::SoundFileReader::can_read ( const std::string &  filepath) const
overridevirtual

Check if this reader can open the given file.

Parameters
filepathPath to the file.
Returns
True if the file can be read, false otherwise.

Implements MayaFlux::IO::FileReader.

Definition at line 68 of file SoundFileReader.cpp.

69{
70 FFmpegDemuxContext probe;
71 if (!probe.open(filepath))
72 return false;
73
74 const AVCodec* codec = nullptr;
75 int idx = probe.find_best_stream(AVMEDIA_TYPE_AUDIO,
76 reinterpret_cast<const void**>(&codec));
77 return idx >= 0 && codec != nullptr;
78}

References MayaFlux::IO::FFmpegDemuxContext::find_best_stream(), and MayaFlux::IO::FFmpegDemuxContext::open().

+ Here is the call graph for this function: