Eric Oulashin's C++ Audio Mixer 1.0
EOUtils Namespace Reference

Namespaces

namespace  sndfile_detail

Classes

class  AiffFile
class  AiffFileInfo
class  AudioFile
class  AudioFileInfo
class  AudioFileResultType
class  FLACFile
class  FLACFileInfo
 Holds metadata for FLAC audio files. More...
class  MetadataAudioFile
 Abstract class that extends AudioFile with pure virtual methods for adding/updating common audio metadata (tags). Derived classes for audio formats that support metadata (e.g., FLAC, Ogg Vorbis) should inherit from this class and implement the metadata operations. More...
class  MP3File
class  MP3FileInfo
struct  OggWriteQuality
struct  OggWriteApproxBitrateKbps
class  OggFile
class  OggFileInfo
class  SndFileBackedMetadataAudioFile
 Shared libsndfile-backed implementation used by MP3, Ogg Vorbis, and AIFF codecs. More...
class  WAVFile
class  WAVFileInfo

Enumerations

enum  AudioFileModes { AUDIO_FILE_READ , AUDIO_FILE_WRITE , AUDIO_FILE_READ_WRITE }
enum class  Mp3BitrateMode : int { Constant = SF_BITRATE_MODE_CONSTANT , Average = SF_BITRATE_MODE_AVERAGE , Variable = SF_BITRATE_MODE_VARIABLE }

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)
static AudioFileResultType sfGetViaTempRead (const std::string &path, int kind, std::string &val)
static AudioFileResultType sfSetViaRw (const std::string &path, int kind, const std::string &value)
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 

◆ Mp3BitrateMode

enum class EOUtils::Mp3BitrateMode : int
strong

Matches SF_BITRATE_MODE_* (libsndfile LAME MPEG layer 3).

Enumerator
Constant 
Average 
Variable 

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.

References EOUtils::FLACFileInfo::isFLACFile(), EOUtils::WAVFileInfo::isWAVFile(), EOUtils::AiffFileInfo::matchesExtension(), EOUtils::MP3FileInfo::matchesExtension(), EOUtils::OggFileInfo::matchesExtension(), EOUtils::AiffFileInfo::sniffFileHeader(), EOUtils::MP3FileInfo::sniffFileHeader(), and EOUtils::OggFileInfo::sniffFileHeader().

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)

◆ getAudioFileInfo()

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

◆ 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, and createAudioFileObjForExistingFile().

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

◆ mixAudioFiles() [2/3]

◆ 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()

◆ sfGetViaTempRead()

AudioFileResultType EOUtils::sfGetViaTempRead ( const std::string & path,
int kind,
std::string & val )
static

◆ sfSetViaRw()

AudioFileResultType EOUtils::sfSetViaRw ( const std::string & path,
int kind,
const std::string & value )
static

◆ stdStringToCString() [1/2]

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

◆ stdStringToCString() [2/2]

CString EOUtils::stdStringToCString ( const string & pStr)

Variable Documentation

◆ machineIsBigEndian