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
HephAudioShared.h File Reference
#include "HephShared.h"
#include <cmath>

Go to the source code of this file.

Macros

#define HEPHAUDIO_VERSION_MAJOR   3
 
#define HEPHAUDIO_VERSION_MINOR   0
 
#define HEPHAUDIO_VERSION_PATCH   6
 
#define HEPHAUDIO_VERSION
 
#define HEPHAUDIO_FORMAT_TAG_PCM   (0x0001)
 
#define HEPHAUDIO_FORMAT_TAG_IEEE_FLOAT   (0x0003)
 
#define HEPHAUDIO_FORMAT_TAG_ALAW   (0x0006)
 
#define HEPHAUDIO_FORMAT_TAG_MULAW   (0x0007)
 
#define HEPHAUDIO_FORMAT_TAG_WMA   (0x0161)
 
#define HEPHAUDIO_FORMAT_TAG_WMAUDIO_LOSSLESS   (0x0163)
 
#define HEPHAUDIO_FORMAT_TAG_WMAVOICE   (0x000A)
 
#define HEPHAUDIO_FORMAT_TAG_MPEG   (0x0050)
 
#define HEPHAUDIO_FORMAT_TAG_MP3   (0x0055)
 
#define HEPHAUDIO_FORMAT_TAG_AAC   (0xA106)
 
#define HEPHAUDIO_FORMAT_TAG_ALAC   (0x6C61)
 
#define HEPHAUDIO_FORMAT_TAG_FLAC   (0xF1AC)
 
#define HEPHAUDIO_FORMAT_TAG_OPUS   (0x704F)
 
#define HEPHAUDIO_FORMAT_TAG_VORBIS   (0x674F)
 
#define HEPHAUDIO_FORMAT_TAG_EXTENSIBLE   (0xFFFE)
 
#define HEPHAUDIO_LOG(logMessage, logType)
 
#define HEPHAUDIO_SPEED_OF_SOUND   343.0
 
#define UINT24_MAX   16777215
 
#define INT24_MIN   (-8388608)
 
#define INT24_MAX   8388607
 
#define HEPH_AUDIO_SAMPLE_MIN   (-1.0f)
 
#define HEPH_AUDIO_SAMPLE_MAX   (1.0f)
 
#define HEPHAUDIO_FORMAT_TAG_HEPHAUDIO_INTERNAL   HEPHAUDIO_FORMAT_TAG_IEEE_FLOAT
 
#define HEPH_AUDIO_SAMPLE_TO_IEEE_FLT(sample)   (sample)
 
#define HEPH_AUDIO_SAMPLE_FROM_IEEE_FLT(fltSample)   (fltSample)
 
#define HEPHAUDIO_ANDROID_OPENSL_MIN_API_LEVEL   (21)
 
#define HEPHAUDIO_ANDROID_AAUDIO_MIN_API_LEVEL   (26)
 

Typedefs

typedef float heph_audio_sample_t
 

Functions

HEPH_API const char * HephAudio::GetVersion ()
 
HEPH_API unsigned int HephAudio::GetVersionMajor ()
 
HEPH_API unsigned int HephAudio::GetVersionMinor ()
 
HEPH_API unsigned int HephAudio::GetVersionPatch ()
 
double HephAudio::DecibelToGain (double decibel)
 
double HephAudio::GainToDecibel (double gain)
 
constexpr double HephAudio::SemitoneToCent (double semitone)
 
constexpr double HephAudio::SemitoneToOctave (double semitone)
 
constexpr double HephAudio::CentToSemitone (double cent)
 
constexpr double HephAudio::CentToOctave (double cent)
 
constexpr double HephAudio::OctaveToSemitone (double octave)
 
constexpr double HephAudio::OctaveToCent (double octave)
 

Macro Definition Documentation

◆ HEPHAUDIO_VERSION_MAJOR

#define HEPHAUDIO_VERSION_MAJOR   3

major part of the version.

◆ HEPHAUDIO_VERSION_MINOR

#define HEPHAUDIO_VERSION_MINOR   0

minor part of the version.

◆ HEPHAUDIO_VERSION_PATCH

#define HEPHAUDIO_VERSION_PATCH   6

patch part of the version.

◆ HEPHAUDIO_VERSION

#define HEPHAUDIO_VERSION
Value:
"v" \
HEPH_TOSTRING(HEPHAUDIO_VERSION_MAJOR) "." \
HEPH_TOSTRING(HEPHAUDIO_VERSION_MINOR) "." \
HEPH_TOSTRING(HEPHAUDIO_VERSION_PATCH)
#define HEPHAUDIO_VERSION_MINOR
Definition HephAudioShared.h:21
#define HEPHAUDIO_VERSION_PATCH
Definition HephAudioShared.h:27
#define HEPHAUDIO_VERSION_MAJOR
Definition HephAudioShared.h:15

full version as string litteral.

◆ HEPHAUDIO_LOG

#define HEPHAUDIO_LOG ( logMessage,
logType )

logs messages to the console. Enabled by defining HEPHAUDIO_INFO_LOGGING.

◆ HEPHAUDIO_SPEED_OF_SOUND

#define HEPHAUDIO_SPEED_OF_SOUND   343.0

speed of sound in dry air at 20 deg C in meters per second

◆ HEPH_AUDIO_SAMPLE_MIN

#define HEPH_AUDIO_SAMPLE_MIN   (-1.0f)

the minimum value an audio sample can have.

◆ HEPH_AUDIO_SAMPLE_MAX

#define HEPH_AUDIO_SAMPLE_MAX   (1.0f)

the maximum value an audio sample can have.

◆ HEPH_AUDIO_SAMPLE_TO_IEEE_FLT

#define HEPH_AUDIO_SAMPLE_TO_IEEE_FLT ( sample)    (sample)

converts heph_audio_sample_t to float.

◆ HEPH_AUDIO_SAMPLE_FROM_IEEE_FLT

#define HEPH_AUDIO_SAMPLE_FROM_IEEE_FLT ( fltSample)    (fltSample)

converts float to heph_audio_sample_t .

◆ HEPHAUDIO_ANDROID_OPENSL_MIN_API_LEVEL

#define HEPHAUDIO_ANDROID_OPENSL_MIN_API_LEVEL   (21)

the minimum API level required for OPENSL ES.

◆ HEPHAUDIO_ANDROID_AAUDIO_MIN_API_LEVEL

#define HEPHAUDIO_ANDROID_AAUDIO_MIN_API_LEVEL   (26)

the minimum API level required for AAudio.

Typedef Documentation

◆ heph_audio_sample_t

typedef float heph_audio_sample_t

type of the audio samples, float by default. Can be changed by defining one of the following macros:

  • HEPH_AUDIO_SAMPLE_TYPE_S16
  • HEPH_AUDIO_SAMPLE_TYPE_S32
  • HEPH_AUDIO_SAMPLE_TYPE_S64
  • HEPH_AUDIO_SAMPLE_TYPE_FLT
  • HEPH_AUDIO_SAMPLE_TYPE_DBL

Function Documentation

◆ DecibelToGain()

double HephAudio::DecibelToGain ( double decibel)
inline

converts decibel to gain (between -1 and 1).

◆ GainToDecibel()

double HephAudio::GainToDecibel ( double gain)
inline

converts gain (between -1 and 1) to decibel.

◆ SemitoneToCent()

double HephAudio::SemitoneToCent ( double semitone)
inlineconstexpr

converts semitone to cent.

◆ SemitoneToOctave()

double HephAudio::SemitoneToOctave ( double semitone)
inlineconstexpr

converts semitone to octave.

◆ CentToSemitone()

double HephAudio::CentToSemitone ( double cent)
inlineconstexpr

converts cent to semitone.

◆ CentToOctave()

double HephAudio::CentToOctave ( double cent)
inlineconstexpr

converts cent to octave.

◆ OctaveToSemitone()

double HephAudio::OctaveToSemitone ( double octave)
inlineconstexpr

converts octave to semitone.

◆ OctaveToCent()

double HephAudio::OctaveToCent ( double octave)
inlineconstexpr

converts octave to cent.