Skip to content

Group core

Core functionalities of the SDK.

Classes

Type Name
class SparkyStudios::Audio::Amplitude::AmAlignedReal32Buffer
Class that handles aligned allocations to support vectorized operations.
struct SparkyStudios::Audio::Amplitude::AmVersion
A structure containing the version number of the library.
class SparkyStudios::Audio::Amplitude::AudioBuffer
Represents an audio buffer containing multiple channels.
class SparkyStudios::Audio::Amplitude::AudioBufferChannel
Represents a view to a single channel in an AudioBuffer .
class SparkyStudios::Audio::Amplitude::AudioBufferCrossFader
Helper class used to cross fade between audio buffers.
class SparkyStudios::Audio::Amplitude::HRIRSphere
Represents a Head-Related Impulse Response (HRIR) sphere.
struct SparkyStudios::Audio::Amplitude::HRIRSphereFileHeaderDescription
Provides metadata about an HRIR sphere file.
struct SparkyStudios::Audio::Amplitude::HRIRSphereVertex
A vertex in a HRIR sphere.
class SparkyStudios::Audio::Amplitude::MPSCQueue <typename T, Capacity>
Lock-free bounded multi-producer single-consumer queue.
class SparkyStudios::Audio::Amplitude::RefCounter
Holds the number of references to an object.
class SparkyStudios::Audio::Amplitude::SPSCQueue <typename T, Capacity>
Lock-free single-producer single-consumer queue.
struct SparkyStudios::Audio::Amplitude::SoundFormat
Describes the format of an audio sample.
class SparkyStudios::Audio::Amplitude::Thread::AwaitablePoolTask
A class representing a task executed within a pool, which allows awaiting its completion.
class SparkyStudios::Audio::Amplitude::Thread::Pool
Pool tasks scheduler class.
class SparkyStudios::Audio::Amplitude::Thread::PoolTask
Base class for pool tasks.

Public Types

Type Name
typedef void(* AmThreadFunction
The AmThreadFunction signature is used to create threads.
enum AmUInt8 eAudioSampleFormat
Lists the possible sample formats handled by Amplitude.
enum AmUInt8 eErrorCode
Lists the possible errors encountered by the library.
enum AmUInt8 eHRIRSphereDatasetModel
The model of the HRIR sphere dataset.
enum AmUInt8 eHRIRSphereSamplingMode
Defines how the HRIR sphere is sampled when doing Ambisonics binauralization.
enum AmUInt8 ePanningMode
Lists the available panning modes.
enum AmUInt8 eScope
Lists the available scopes for sound objects.
enum AmUInt8 eSpatialization
Lists the available spatialization modes.

Public Attributes

Type Name
AmSize kAm51SurroundChannelCount = 6
The number of channels in a 5.1-surround audio source.
AmSize kAm71SurroundChannelCount = 8
The number of channels in a 7.1-surround audio source.
AmUInt32 kAmAirAbsorptionBandCount = 3
The number of air absorption bands for attenuation models.
AmSize kAmFirstOrderAmbisonicChannelCount = 4
The number of channels in a first-order ambisonic source.
AmInt32 kAmFixedPointBits = 15
The number of bits to shift when processing audio data with floating point values.
AmInt32 kAmFixedPointMask = (kAmFixedPointBits - 1)
Used to mask the bits when processing audio data with fixed-point values.
AmInt32 kAmFixedPointUnit = (1 &lt;&lt; kAmFixedPointBits)
The unit value for a 32-bit fixed-point audio sample.
AmObjectID kAmInvalidObjectId = 0
Invalid Amplitude object ID.
AmBusID kAmMasterBusId = 1
Specifies the value of the "master" bus ID.
AmSize kAmMaxChannelInstances = 1024
The maximum number of channel instances supported per channel.
AmUInt32 kAmMaxSupportedAmbisonicOrder = 3
The maximum supported ambisonic order.
AmUInt32 kAmMaxSupportedChannelCount = (kAmMaxSupportedAmbisonicOrder + 1) \* (kAmMaxSupportedAmbisonicOrder + 1)
The maximum supported channel count for an ambisonic source.
AmUInt64 kAmMaxSupportedFrameCount = 16384
The maximum number of frames that can be processed at once.
AmSize kAmMonoChannelCount = 1
The number of channels in a mono audio source.
AmSize kAmRoomSurfaceCount = 6
The number of surfaces in a room.
AmTime kAmSecond = 1000.0
The number of milliseconds in one second.
AmSize kAmSecondOrderAmbisonicChannelCount = 9
The number of channels in a second-order ambisonic source.
AmSize kAmStereoChannelCount = 2
The number of channels in a stereo audio source.
AmSize kAmThirdOrderAmbisonicChannelCount = 16
The number of channels in a third-order ambisonic source.
AmReal32 kEpsilon = 1e-6f
Minimum value where values lower than this are considered to be 0.
AmReal32 kHighCutoffFrequencies = { 800.0f, 8000.0f, 22000.0f }
The high cutoff frequencies for air absorption models.
AmReal32 kLowCutoffFrequencies = { 0.0f, 800.0f, 8000.0f }
The low cutoff frequencies for air absorption models.
AmTime kMinFadeDuration = 10.0
The minimum fade duration in milliseconds.

Public Functions

Type Name
AmThreadHandle CreateThread (AmThreadFunction threadFunction, AmVoidPtr parameter=nullptr)
Creates a new thread.
AmUInt32 GetCPUCount ()
Gets the number of hardware CPU.
AmThreadID GetCurrentThreadId ()
Gets the handle of the calling thread.
AmUInt64 GetTimeMillis ()
Gets the total execution time in milliseconds for the calling thread.
const AmVersion & GetVersion ()
Returns the version.
void Release (AmThreadHandle & thread)
Manually stops a thread execution.
void Sleep (AmInt32 milliseconds)
Makes the calling thread sleep for the given number of milliseconds.
void Wait (AmThreadHandle & thread)
Waits for the given thread to stop.

Macros

Type Name
define AM_CALLBACK (_type_, _name_) typedef \_type\_(AM\_CALL\_POLICY\* \_name\_)
Declare a callback function type.
define AM_TO_STRING (X) AM\_STRING\_EXPAND(X)
Turn X into a string literal.
define AM_UNUSED (x) ((void)(x))
Helps to avoid compiler warnings about unused values.
define amVersion [**SparkyStudios::Audio::Amplitude::GetVersion**](group__core.md#function-getversion)()
Gets the current Amplitude SDK version.

Public Types Documentation

AmThreadFunction

The AmThreadFunction signature is used to create threads.

typedef void(* SparkyStudios::Audio::Amplitude::AmThreadFunction) (AmVoidPtr param);
eAudioSampleFormat

Lists the possible sample formats handled by Amplitude.

enum eAudioSampleFormat {
    eAudioSampleFormat_Float32,
    eAudioSampleFormat_Int16,
    eAudioSampleFormat_Unknown
};
eErrorCode

Lists the possible errors encountered by the library.

enum eErrorCode {
    eErrorCode_Success = 0,
    eErrorCode_InvalidParameter = 1,
    eErrorCode_FileNotFound = 2,
    eErrorCode_FileLoadFailed = 3,
    eErrorCode_DllNotFound = 4,
    eErrorCode_OutOfMemory = 5,
    eErrorCode_NotImplemented = 6,
    eErrorCode_Unknown = 7
};
eHRIRSphereDatasetModel

The model of the HRIR sphere dataset.

enum eHRIRSphereDatasetModel {
    eHRIRSphereDatasetModel_IRCAM = 0,
    eHRIRSphereDatasetModel_MIT = 1,
    eHRIRSphereDatasetModel_SADIE = 2,
    eHRIRSphereDatasetModel_SOFA = 3,
    eHRIRSphereDatasetModel_Invalid
};
eHRIRSphereSamplingMode

Defines how the HRIR sphere is sampled when doing Ambisonics binauralization.

enum eHRIRSphereSamplingMode {
    eHRIRSphereSamplingMode_Bilinear = 0,
    eHRIRSphereSamplingMode_NearestNeighbor = 1
};
ePanningMode

Lists the available panning modes.

enum ePanningMode {
    ePanningMode_Stereo = 0,
    ePanningMode_BinauralLowQuality = 1,
    ePanningMode_BinauralMediumQuality = 2,
    ePanningMode_BinauralHighQuality = 3
};
eScope

Lists the available scopes for sound objects.

enum eScope {
    eScope_World,
    eScope_Entity
};
eSpatialization

Lists the available spatialization modes.

enum eSpatialization {
    eSpatialization_None,
    eSpatialization_Position,
    eSpatialization_PositionOrientation,
    eSpatialization_HRTF
};

Public Attributes Documentation

kAm51SurroundChannelCount

The number of channels in a 5.1-surround audio source.

AmSize SparkyStudios::Audio::Amplitude::kAm51SurroundChannelCount;
kAm71SurroundChannelCount

The number of channels in a 7.1-surround audio source.

AmSize SparkyStudios::Audio::Amplitude::kAm71SurroundChannelCount;
kAmAirAbsorptionBandCount

The number of air absorption bands for attenuation models.

AmUInt32 SparkyStudios::Audio::Amplitude::kAmAirAbsorptionBandCount;
kAmFirstOrderAmbisonicChannelCount

The number of channels in a first-order ambisonic source.

AmSize SparkyStudios::Audio::Amplitude::kAmFirstOrderAmbisonicChannelCount;
kAmFixedPointBits

The number of bits to shift when processing audio data with floating point values.

AmInt32 SparkyStudios::Audio::Amplitude::kAmFixedPointBits;
kAmFixedPointMask

Used to mask the bits when processing audio data with fixed-point values.

AmInt32 SparkyStudios::Audio::Amplitude::kAmFixedPointMask;
kAmFixedPointUnit

The unit value for a 32-bit fixed-point audio sample.

AmInt32 SparkyStudios::Audio::Amplitude::kAmFixedPointUnit;
kAmInvalidObjectId

Invalid Amplitude object ID.

AmObjectID SparkyStudios::Audio::Amplitude::kAmInvalidObjectId;
kAmMasterBusId

Specifies the value of the "master" bus ID.

AmBusID SparkyStudios::Audio::Amplitude::kAmMasterBusId;
kAmMaxChannelInstances

The maximum number of channel instances supported per channel.

AmSize SparkyStudios::Audio::Amplitude::kAmMaxChannelInstances;
kAmMaxSupportedAmbisonicOrder

The maximum supported ambisonic order.

AmUInt32 SparkyStudios::Audio::Amplitude::kAmMaxSupportedAmbisonicOrder;
kAmMaxSupportedChannelCount

The maximum supported channel count for an ambisonic source.

AmUInt32 SparkyStudios::Audio::Amplitude::kAmMaxSupportedChannelCount;
kAmMaxSupportedFrameCount

The maximum number of frames that can be processed at once.

AmUInt64 SparkyStudios::Audio::Amplitude::kAmMaxSupportedFrameCount;
kAmMonoChannelCount

The number of channels in a mono audio source.

AmSize SparkyStudios::Audio::Amplitude::kAmMonoChannelCount;
kAmRoomSurfaceCount

The number of surfaces in a room.

AmSize SparkyStudios::Audio::Amplitude::kAmRoomSurfaceCount;

Warning:

Only cube-shaped rooms are supported.

kAmSecond

The number of milliseconds in one second.

AmTime SparkyStudios::Audio::Amplitude::kAmSecond;
kAmSecondOrderAmbisonicChannelCount

The number of channels in a second-order ambisonic source.

AmSize SparkyStudios::Audio::Amplitude::kAmSecondOrderAmbisonicChannelCount;
kAmStereoChannelCount

The number of channels in a stereo audio source.

AmSize SparkyStudios::Audio::Amplitude::kAmStereoChannelCount;
kAmThirdOrderAmbisonicChannelCount

The number of channels in a third-order ambisonic source.

AmSize SparkyStudios::Audio::Amplitude::kAmThirdOrderAmbisonicChannelCount;
kEpsilon

Minimum value where values lower than this are considered to be 0.

AmReal32 SparkyStudios::Audio::Amplitude::kEpsilon;
kHighCutoffFrequencies

The high cutoff frequencies for air absorption models.

AmReal32 SparkyStudios::Audio::Amplitude::kHighCutoffFrequencies[kAmAirAbsorptionBandCount];
kLowCutoffFrequencies

The low cutoff frequencies for air absorption models.

AmReal32 SparkyStudios::Audio::Amplitude::kLowCutoffFrequencies[kAmAirAbsorptionBandCount];
kMinFadeDuration

The minimum fade duration in milliseconds.

AmTime SparkyStudios::Audio::Amplitude::kMinFadeDuration;

Public Functions Documentation

CreateThread

Creates a new thread.

AmThreadHandle CreateThread (
    AmThreadFunction threadFunction,
    AmVoidPtr parameter=nullptr
) 

Parameters:

  • threadFunction The function to run in the thread.
  • parameter An optional shared data to pass to the thread
GetCPUCount

Gets the number of hardware CPU.

AmUInt32 GetCPUCount () 
GetCurrentThreadId

Gets the handle of the calling thread.

AmThreadID GetCurrentThreadId () 
GetTimeMillis

Gets the total execution time in milliseconds for the calling thread.

AmUInt64 GetTimeMillis () 
GetVersion

Returns the version.

const AmVersion & GetVersion () 

Returns:

The current SDK version.

Release

Manually stops a thread execution.

void Release (
    AmThreadHandle & thread
) 

Parameters:

  • thread The handle of the thread to stop.
Sleep

Makes the calling thread sleep for the given number of milliseconds.

void Sleep (
    AmInt32 milliseconds
) 

Parameters:

  • milliseconds The amount of time the calling thread should sleep.
Wait

Waits for the given thread to stop.

void Wait (
    AmThreadHandle & thread
) 

Parameters:

  • thread The handle of the thread to wait.

Macro Definition Documentation

AM_CALLBACK

Declare a callback function type.

#define AM_CALLBACK (
    _type_,
    _name_
) `typedef _type_(AM_CALL_POLICY* _name_)`

Parameters:

  • _type_ Return type of the function
  • _name_ Name of the function

Note:

This must be followed by the parentheses containing the function arguments declaration.

AM_TO_STRING

Turn X into a string literal.

#define AM_TO_STRING (
    X
) `AM_STRING_EXPAND(X)`

Parameters:

  • X The value to transform into a string literal
AM_UNUSED

Helps to avoid compiler warnings about unused values.

#define AM_UNUSED (
    x
) `((void)(x))`

Parameters:

  • x The statement where the return value is not used.
amVersion

Gets the current Amplitude SDK version.

#define amVersion `SparkyStudios::Audio::Amplitude::GetVersion ()`