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::IAudioEncoder Class Referenceabstract

interface for the audio encoders. More...

#include <IAudioEncoder.h>

Inheritance diagram for HephAudio::IAudioEncoder:
HephAudio::FFmpegAudioEncoder

Public Member Functions

virtual ~IAudioEncoder ()=default
 
virtual void ChangeFile (const std::filesystem::path &newAudioFilePath, const AudioFormatInfo &outputFormatInfo, bool overwrite)=0
 
virtual void CloseFile ()=0
 
virtual bool IsFileOpen () const =0
 
virtual void Encode (const AudioBuffer &bufferToEncode)=0
 
virtual void Encode (const AudioBuffer &inputBuffer, EncodedAudioBuffer &outputBuffer)=0
 
virtual void Transcode (const EncodedAudioBuffer &inputBuffer, EncodedAudioBuffer &outputBuffer)=0
 

Protected Attributes

std::filesystem::path filePath
 

Detailed Description

interface for the audio encoders.

Constructor & Destructor Documentation

◆ ~IAudioEncoder()

virtual HephAudio::IAudioEncoder::~IAudioEncoder ( )
virtualdefault

releases the resources and destroys the instance.

Member Function Documentation

◆ ChangeFile()

virtual void HephAudio::IAudioEncoder::ChangeFile ( const std::filesystem::path & newAudioFilePath,
const AudioFormatInfo & outputFormatInfo,
bool overwrite )
pure virtual

changes the file that will store the encoded audio data.

Parameters
outputFormatInfotarget format.
overwriteindicates whether to write over the file if it already exists.

Implemented in HephAudio::FFmpegAudioEncoder.

◆ CloseFile()

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

closes the file and releases the resources allocated for encoding.

Implemented in HephAudio::FFmpegAudioEncoder.

◆ IsFileOpen()

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

checks whether a file is currently open.

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

Implemented in HephAudio::FFmpegAudioEncoder.

◆ Encode() [1/2]

virtual void HephAudio::IAudioEncoder::Encode ( const AudioBuffer & bufferToEncode)
pure virtual

encodes the provided audio data and writes it to the file.

Implemented in HephAudio::FFmpegAudioEncoder.

◆ Encode() [2/2]

virtual void HephAudio::IAudioEncoder::Encode ( const AudioBuffer & inputBuffer,
EncodedAudioBuffer & outputBuffer )
pure virtual

encodes the provided audio data and writes it to the outputBuffer.

Parameters
inputBufferthe buffer that contains the audio data that will be encoded.
outputBufferthe buffer that will store the encoded audio data.

Implemented in HephAudio::FFmpegAudioEncoder.

◆ Transcode()

virtual void HephAudio::IAudioEncoder::Transcode ( const EncodedAudioBuffer & inputBuffer,
EncodedAudioBuffer & outputBuffer )
pure virtual

transcodes the provided audio data and writes it to the outputBuffer.

Parameters
inputBufferthe buffer that contains the audio data that will be transcoded.
outputBufferthe buffer that will store the transcoded audio data.

Implemented in HephAudio::FFmpegAudioEncoder.

Member Data Documentation

◆ filePath

std::filesystem::path HephAudio::IAudioEncoder::filePath
protected

path of the file that will store the encoded audio data.