HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
HephAudio::IAudioDecoder Class Referenceabstract

interface for the audio decoders. More...

#include <IAudioDecoder.h>

Inheritance diagram for HephAudio::IAudioDecoder:
HephAudio::FFmpegAudioDecoder

Public Member Functions

virtual ~IAudioDecoder ()=default
 
virtual void ChangeFile (const std::filesystem::path &newFilePath)=0
 
virtual void CloseFile ()=0
 
virtual bool IsFileOpen () const =0
 
virtual AudioFormatInfo GetOutputFormatInfo () const =0
 
virtual size_t GetFrameCount () const =0
 
virtual bool Seek (size_t frameIndex)=0
 
virtual AudioBuffer Decode ()=0
 
virtual AudioBuffer Decode (size_t frameCount)=0
 
virtual AudioBuffer Decode (size_t frameIndex, size_t frameCount)=0
 
virtual AudioBuffer Decode (const EncodedAudioBuffer &encodedBuffer)=0
 

Protected Attributes

std::filesystem::path filePath
 

Detailed Description

interface for the audio decoders.

Constructor & Destructor Documentation

◆ ~IAudioDecoder()

virtual HephAudio::IAudioDecoder::~IAudioDecoder ( )
virtualdefault

releases the resources and destroys the instance.

Member Function Documentation

◆ ChangeFile()

virtual void HephAudio::IAudioDecoder::ChangeFile ( const std::filesystem::path & newFilePath)
pure virtual

changes the decoded file.

Implemented in HephAudio::FFmpegAudioDecoder.

◆ CloseFile()

virtual void HephAudio::IAudioDecoder::CloseFile ( )
pure virtual

closes the file that's being decoded and releases the resources allocated for decoding.

Implemented in HephAudio::FFmpegAudioDecoder.

◆ IsFileOpen()

virtual bool HephAudio::IAudioDecoder::IsFileOpen ( ) const
pure virtual

checks whether a file is currently open for decoding.

Returns
true if a file is currently open, otherwise false.

Implemented in HephAudio::FFmpegAudioDecoder.

◆ GetOutputFormatInfo()

virtual AudioFormatInfo HephAudio::IAudioDecoder::GetOutputFormatInfo ( ) const
pure virtual

gets the AudioFormatInfo the audio file will be decoded to.

Implemented in HephAudio::FFmpegAudioDecoder.

◆ GetFrameCount()

virtual size_t HephAudio::IAudioDecoder::GetFrameCount ( ) const
pure virtual

gets the number of audio frames the audio file contains.

Implemented in HephAudio::FFmpegAudioDecoder.

◆ Seek()

virtual bool HephAudio::IAudioDecoder::Seek ( size_t frameIndex)
pure virtual

seeks an audio frame in the file.

Parameters
frameIndexindex of the audio frame.
Returns
true if the frame is found, otherwise false.

Implemented in HephAudio::FFmpegAudioDecoder.

◆ Decode() [1/4]

virtual AudioBuffer HephAudio::IAudioDecoder::Decode ( )
pure virtual

decodes the audio file.

Implemented in HephAudio::FFmpegAudioDecoder.

◆ Decode() [2/4]

virtual AudioBuffer HephAudio::IAudioDecoder::Decode ( size_t frameCount)
pure virtual

decodes the audio file.

Parameters
frameCountnumber of frames to decode.

Implemented in HephAudio::FFmpegAudioDecoder.

◆ Decode() [3/4]

virtual AudioBuffer HephAudio::IAudioDecoder::Decode ( size_t frameIndex,
size_t frameCount )
pure virtual

decodes the specified portion of the audio file.

Parameters
frameIndexindex of the first frame that will be decoded.
frameCountnumber of frames to decode.

Implemented in HephAudio::FFmpegAudioDecoder.

◆ Decode() [4/4]

virtual AudioBuffer HephAudio::IAudioDecoder::Decode ( const EncodedAudioBuffer & encodedBuffer)
pure virtual

decodes the encoded audio data in the memory.

Parameters
encodedBufferthe buffer that contains the encoded audio data.

Implemented in HephAudio::FFmpegAudioDecoder.

Member Data Documentation

◆ filePath

std::filesystem::path HephAudio::IAudioDecoder::filePath
protected

path of the file that's being decoded.