MayaFlux 0.4.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 69 of file SoundFileReader.cpp.

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

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

Referenced by load_bounded().

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