Mach1 Spatial SDK
Loading...
Searching...
No Matches
Mach1Decode< PCM > Class Template Reference

Public Member Functions

void setPlatformType (Mach1PlatformType type)
 Set the device's angle order and convention if applicable.
 
void setDecodeMode (Mach1DecodeMode mode)
 Set the decoding mode.
 
Mach1PlatformType getPlatformType ()
 Get the device's angle order and convention if applicable.
 
Mach1DecodeMode getDecodeMode ()
 Get the decoding mode.
 
int getFormatChannelCount ()
 Get the get amount of channels that this Mach1Decode expects to decode, based on the currently active decoding mode.
 
int getFormatCoeffCount ()
 Get the get amount of decoding coefficients this Mach1Decode will generate, based on the currently active decoding algorithm.
 
void setRotation (Mach1Point3D newRotationFromMinusOnetoOne)
 Set current buffer/sample intended decoding orientation YPR.
 
void setRotationDegrees (Mach1Point3D newRotationDegrees)
 Set current buffer/sample intended decoding orientation YPR.
 
void setRotationRadians (Mach1Point3D newRotationRadians)
 Set current buffer/sample intended decoding orientation YPR.
 
void setRotationQuat (Mach1Point4D newRotationQuat)
 Set current buffer/sample intended decoding orientation YPR.
 
void setFilterSpeed (float filterSpeed)
 Set the amount of angle smoothing applied to the orientation angles used for this Mach1Decode.
 
long getCurrentTime ()
 Get the current elapsed time in milliseconds (ms) this Mach1Decode has been constructed.
 
Mach1Point3D getCurrentAngle ()
 Get this Mach1Decode's current 3D angle for feedback design.
 
std::vector< PCM > decode (float Yaw, float Pitch, float Roll, int bufferSize=0, int sampleIndex=0)
 
std::vector< PCM > decodeCoeffs (int bufferSize=0, int sampleIndex=0)
 
std::vector< PCM > decodePannedCoeffs (int bufferSize=0, int sampleIndex=0, bool applyPanLaw=true)
 
std::vector< PCM > decodeCoeffsUsingTranscodeMatrix (std::vector< std::vector< float > > matrix, int channels, int bufferSize=0, int sampleIndex=0)
 
void decodeBuffer (std::vector< std::vector< PCM > > &in, std::vector< std::vector< PCM > > &out, int size)
 
void decodeBufferInPlace (std::vector< std::vector< PCM > > &buffer, int size)
 
void decodeBufferRebuffer (std::vector< std::vector< PCM > > &in, std::vector< std::vector< PCM > > &out, int size)
 
void decodeBufferInPlaceRebuffer (std::vector< std::vector< PCM > > &buffer, int size)
 
void decode (float Yaw, float Pitch, float Roll, float *result, int bufferSize=0, int sampleIndex=0)
 
void decodeCoeffs (float *result, int bufferSize=0, int sampleIndex=0)
 
void decodePannedCoeffs (float *result, int bufferSize=0, int sampleIndex=0, bool applyPanLaw=true)
 
char * getLog ()
 Get the internal log that has been accumulated into this Mach1Decode.
 

Member Function Documentation

◆ decode()

template<typename PCM >
std::vector< PCM > Mach1Decode< PCM >::decode ( float  Yaw,
float  Pitch,
float  Roll,
int  bufferSize = 0,
int  sampleIndex = 0 
)

Call with current update's angles to return the coefficients with which an incoming audio buffer may be decoded.

Includes two modes of use:

  1. Use your audio player's buffersize and current sample index for sync callbacks, with buffer size and sample index as parameters.
  2. Update decode results via main loop (or any loop)

Setting bufferSize and sampleIndex to 0 will enable the second mode.

Parameters
Yawfloat for device/listener yaw angle: [Range: 0->360 | -180->180]
Pitchfloat for device/listener pitch angle: [Range: -90->90]
Rollfloat for device/listener roll angle: [Range: -90->90]
bufferSizeint for number of samples in a buffer, ideally supplied from your audioplayer/engine
sampleIndexint for current sample index array, ideally supplied from your audioplayer/engine

◆ decodeCoeffs()

template<typename PCM >
std::vector< PCM > Mach1Decode< PCM >::decodeCoeffs ( int  bufferSize = 0,
int  sampleIndex = 0 
)

Call with current update's angles to return the coefficients with which an incoming audio buffer may be decoded.

Includes two modes of use:

  1. Use your audio player's buffersize and current sample index for sync callbacks, with buffer size and sample index as parameters.
  2. Update decode results via main loop (or any loop)

Setting bufferSize and sampleIndex to 0 will enable the second mode.

Parameters
bufferSizeint for number of samples in a buffer, ideally supplied from your audioplayer/engine
sampleIndexint for current sample index array, ideally supplied from your audioplayer/engine

◆ decodePannedCoeffs()

template<typename PCM >
std::vector< PCM > Mach1Decode< PCM >::decodePannedCoeffs ( int  bufferSize = 0,
int  sampleIndex = 0,
bool  applyPanLaw = true 
)

Call with current update's angles to return the coefficients with which an incoming audio buffer may be decoded.

Includes two modes of use:

  1. Use your audio player's buffersize and current sample index for sync callbacks, with buffer size and sample index as parameters.
  2. Update decode results via main loop (or any loop)

Setting bufferSize and sampleIndex to 0 will enable the second mode.

Parameters
bufferSizeint for number of samples in a buffer, ideally supplied from your audioplayer/engine
sampleIndexint for current sample index array, ideally supplied from your audioplayer/engine
applyPanLawbool for control over panLaw application.

◆ setFilterSpeed()

template<typename PCM >
void Mach1Decode< PCM >::setFilterSpeed ( float  filterSpeed)

Set the amount of angle smoothing applied to the orientation angles used for this Mach1Decode.

Parameters
filterSpeedfloating point value between [0.0001 -> 1.0], where 1.0 represents no filter.

◆ setRotation()

template<typename PCM >
void Mach1Decode< PCM >::setRotation ( Mach1Point3D  newRotationFromMinusOnetoOne)

Set current buffer/sample intended decoding orientation YPR.

Parameters
newRotationFromMinusOnetoOne
  • Yaw: [Range: 0.0 -> 1.0 | -0.5 -> 0.5]; [Range: 0.0 -> 360 | -180 -> 180]
  • Pitch: [Range: -0.25 -> 0.25]; [Range: -90 -> 90]
  • Roll: [Range: -0.25 -> 0.25]; [Range: -90 -> 90]

◆ setRotationDegrees()

template<typename PCM >
void Mach1Decode< PCM >::setRotationDegrees ( Mach1Point3D  newRotationDegrees)

Set current buffer/sample intended decoding orientation YPR.

Parameters
newRotationFromMinusOnetoOne
  • Yaw: [Range: 0.0 -> 360 | -180 -> 180]
  • Pitch: [Range: -90 -> 90]
  • Roll: [Range: -90 -> 90]

◆ setRotationQuat()

template<typename PCM >
void Mach1Decode< PCM >::setRotationQuat ( Mach1Point4D  newRotationQuat)

Set current buffer/sample intended decoding orientation YPR.

Parameters
newRotationFromMinusOnetoOne
  • W: [Range: -1.0 -> 1.0]
  • X: [Range: -1.0 -> 1.0]
  • Y: [Range: -1.0 -> 1.0]
  • Z: [Range: -1.0 -> 1.0]

◆ setRotationRadians()

template<typename PCM >
void Mach1Decode< PCM >::setRotationRadians ( Mach1Point3D  newRotationRadians)

Set current buffer/sample intended decoding orientation YPR.

Parameters
newRotationFromMinusOnetoOne
  • Yaw: [Range: 0.0 -> 2PI | -PI -> PI]; [Range: 0.0 -> 360 | -180 -> 180]
  • Pitch: [Range: -PI/2 -> PI/2]; [Range: -90 -> 90]
  • Roll: [Range: -PI/2 -> PI/2]; [Range: -90 -> 90]

The documentation for this class was generated from the following file: