libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
Ship::SoundMatrixDecoder Class Reference

#include <SoundMatrixDecoder.h>

Public Member Functions

 SoundMatrixDecoder (int32_t sampleRate)
 
 ~SoundMatrixDecoder ()=default
 
void ResetState ()
 
std::tuple< const uint8_t *, int > Process (const uint8_t *buf, size_t len)
 

Detailed Description

Passive matrix decoder for stereo to 5.1 surround upmixing. Implements standard audio matrix decoding techniques using:

  • Linkwitz-Riley crossover filters for frequency band separation
  • All-pass filters for phase manipulation
  • Delay lines for surround channel timing

Constructor & Destructor Documentation

◆ SoundMatrixDecoder()

Ship::SoundMatrixDecoder::SoundMatrixDecoder ( int32_t  sampleRate)

Construct and initialize the decoder with a specific sample rate.

Parameters
sampleRateThe audio sample rate in Hz

◆ ~SoundMatrixDecoder()

Ship::SoundMatrixDecoder::~SoundMatrixDecoder ( )
default

Member Function Documentation

◆ Process()

std::tuple< const uint8_t *, int > Ship::SoundMatrixDecoder::Process ( const uint8_t *  buf,
size_t  len 
)

Decode stereo to 5.1 surround

Parameters
stereoInputInterleaved stereo samples [L0, R0, L1, R1, ...]
samplePairsNumber of stereo sample pairs to process
Returns
Pointer to internal buffer with interleaved 5.1 samples [FL, FR, C, LFE, SL, SR, ...]

◆ ResetState()

void Ship::SoundMatrixDecoder::ResetState ( )

Reset filter states without recomputing coefficients. Useful when audio is interrupted to prevent clicks.


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