Eric Oulashin's C++ Audio Mixer 1.0
Classes | Enumerations | Functions | Variables
EOUtils Namespace Reference

Classes

class  AudioFile
 
class  AudioFileInfo
 
class  AudioFileResultType
 
class  FLACFile
 
class  FLACFileInfo
 Holds metadata for FLAC audio files. More...
 
class  WAVFile
 
class  WAVFileInfo
 

Enumerations

enum  AudioFileModes { AUDIO_FILE_READ , AUDIO_FILE_WRITE , AUDIO_FILE_READ_WRITE }
 

Functions

string CStringToStdString (const CString &pCStr)
 
CString stdStringToCString (const string &pStr)
 
CString stdStringToCString (const std::string &pStr)
 
std::shared_ptr< AudioFilecreateAudioFileObjForExistingFile (const char *pFilename)
 Creates a shared pointer to an audioFile object for an existing audio file - Creates the appropriate subclass object, depending on the file format.
 
std::shared_ptr< AudioFilecreateAudioFileObjForNewFile (const char *pFilename)
 Creates a shared pointer to an audioFile object for a new (non-existing) audio file - Creates the appropriate subclass object, depending on the filename extension. If the format isn't recognized, returns a null pointer.
 
std::string getFileExtensionUpper (const char *pFilename)
 Returns a filename's extension in uppercase, or an empty string if there is no extension. The extension is the part of the filename after the last dot.
 
AudioFileResultType getAudioFileInfo (const char *pFilename, AudioFileInfo &pAudioFileInfo)
 Gets information about an audio file.
 
AudioFileResultType mixAudioFiles (const std::vector< std::string > &pFilenames, const std::string &pOutputFilename)
 Mixes (merges) multiple audio files into a single file.
 
AudioFileResultType mixAudioFiles (const std::vector< std::string > &pFilenames, std::shared_ptr< AudioFile > &pOutputAudioFile)
 Mixes (merges) multiple audio files into a single file.
 
AudioFileResultType mixAudioFiles (const std::vector< std::string > &pFilenames, EOUtils::AudioFile &pOutputAudioFile)
 
AudioFileResultType getHighestSampleValue_64bit (const std::vector< std::string > &pFilenames, int64_t &pHighestAudioSample)
 Gets the highest audio sample from a set of audio files, cast to a 64-bit integer.
 
bool isBigEndian ()
 
void reverseBytes (void *pStart, int pSize)
 
size_t getFileSize (const char *pFilename)
 
template<typename T >
maxValue ()
 
template<typename T >
minValue ()
 

Variables

static bool machineIsBigEndian = isBigEndian()
 

Enumeration Type Documentation

◆ AudioFileModes

Enumerator
AUDIO_FILE_READ 
AUDIO_FILE_WRITE 
AUDIO_FILE_READ_WRITE 

Function Documentation

◆ createAudioFileObjForExistingFile()

shared_ptr< AudioFile > EOUtils::createAudioFileObjForExistingFile ( const char *  pFilename)

Creates a shared pointer to an audioFile object for an existing audio file - Creates the appropriate subclass object, depending on the file format.

Parameters
[in]pFilenameThe name of the audio file
Returns
A shared pointer to an AudioFile object, which will be an instance of the appropriate subclass for the file, or a null pointer if it is not a recognized format.

Referenced by getHighestSampleValue_64bit(), and mixAudioFiles().

◆ createAudioFileObjForNewFile()

shared_ptr< AudioFile > EOUtils::createAudioFileObjForNewFile ( const char *  pFilename)

Creates a shared pointer to an audioFile object for a new (non-existing) audio file - Creates the appropriate subclass object, depending on the filename extension. If the format isn't recognized, returns a null pointer.

Parameters
[in]pFilenameThe name of the audio file
Returns
A shared pointer to an AudioFile object, which will be an instance of the appropriate subclass for the file, or a null pointer if it is not a recognized format.

References getFileExtensionUpper().

◆ CStringToStdString()

std::string EOUtils::CStringToStdString ( const CString &  pCStr)

References CStringToStdString().

Referenced by CStringToStdString().

◆ getAudioFileInfo()

AudioFileResultType EOUtils::getAudioFileInfo ( const char *  pFilename,
AudioFileInfo pAudioFileInfo 
)

Gets information about an audio file.

Parameters
[in]pFilenameThe name of the audio file
[out]pAudioFileInfoAn AudioFileInfo object that will be populated with information about the audio file
Returns
True on success, or false with error messages on failure

References EOUtils::AudioFileResultType::addError(), EOUtils::AudioFileInfo::copyAudioFileInfo(), EOUtils::AudioFileResultType::numErrors(), and result.

Referenced by mixAudioFiles().

◆ getFileExtensionUpper()

string EOUtils::getFileExtensionUpper ( const char *  pFilename)

Returns a filename's extension in uppercase, or an empty string if there is no extension. The extension is the part of the filename after the last dot.

Parameters
[in]pFilenameThe name of the audio file
Returns
The extension of the filename in uppercase, or an empty string if there is no extension.

Referenced by createAudioFileObjForNewFile().

◆ getFileSize()

size_t EOUtils::getFileSize ( const char *  pFilename)

◆ getHighestSampleValue_64bit()

AudioFileResultType EOUtils::getHighestSampleValue_64bit ( const std::vector< std::string > &  pFilenames,
int64_t &  pHighestAudioSample 
)

Gets the highest audio sample from a set of audio files, cast to a 64-bit integer.

Parameters
[in]pFilenamesA collection of audio file names
[out]pHighestAudioSampleThis will contain the highest audio sample found in the audio files
Returns
True on success, or false with error messages on failure

References EOUtils::AudioFileResultType::addError(), AUDIO_FILE_READ, createAudioFileObjForExistingFile(), and result.

Referenced by mixAudioFiles().

◆ isBigEndian()

bool EOUtils::isBigEndian ( )

◆ maxValue()

template<typename T >
T EOUtils::maxValue ( )

◆ minValue()

template<typename T >
T EOUtils::minValue ( )

◆ mixAudioFiles() [1/3]

AudioFileResultType EOUtils::mixAudioFiles ( const std::vector< std::string > &  pFilenames,
const std::string &  pOutputFilename 
)

Mixes (merges) multiple audio files into a single file.

Parameters
[in]pFilenamesA collection of filenames of audio files to mix
[out]pOutputFilenameThe filename for the resulting mixed audio file
Returns
True on success, or false with error messages on failure

References mixAudioFiles().

Referenced by mixAudioFiles(), and mixAudioFiles().

◆ mixAudioFiles() [2/3]

AudioFileResultType EOUtils::mixAudioFiles ( const std::vector< std::string > &  pFilenames,
EOUtils::AudioFile pOutputAudioFile 
)

◆ mixAudioFiles() [3/3]

AudioFileResultType EOUtils::mixAudioFiles ( const std::vector< std::string > &  pFilenames,
std::shared_ptr< AudioFile > &  pOutputAudioFile 
)

Mixes (merges) multiple audio files into a single file.

Parameters
[in]pFilenamesA collection of filenames of audio files to mix
[in,out]pOutputAudioFileAn AudioFile object for the resulting mixed audio file. This should be an instance of the desired subclass for the output file format, and does not need to be open (in fact, it's better if it's not open yet)
Returns
True on success, or false with error messages on failure

References mixAudioFiles().

◆ reverseBytes()

void EOUtils::reverseBytes ( void *  pStart,
int  pSize 
)

◆ stdStringToCString() [1/2]

CString EOUtils::stdStringToCString ( const std::string &  pStr)

◆ stdStringToCString() [2/2]

CString EOUtils::stdStringToCString ( const string &  pStr)

Variable Documentation

◆ machineIsBigEndian

bool EOUtils::machineIsBigEndian = isBigEndian()
static