Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::hal::audio Namespace Reference

Audio streams and the sample clock. More...

Detailed Description

Audio streams and the sample clock.

Classes

struct  AudioConfig
 Audio stream configuration. More...
 
class  FrameCount
 
struct  FrameStamp
 

Typedefs

using AudioCallback = void(*)(int32_t *tx_buf, const int32_t *rx_buf, uint16_t frames)
 Audio processing callback (called from ISR context)
 

Enumerations

enum class  SaiLayout : uint8_t { A_TX_B_RX , A_RX_B_TX }
 SAI block direction layout. More...
 

Typedef Documentation

◆ AudioCallback

using sbl::hal::audio::AudioCallback = typedef void (*)(int32_t* tx_buf, const int32_t* rx_buf, uint16_t frames)

Audio processing callback (called from ISR context)

One int32_t per sample: 24-bit two's complement, right-aligned, the format <sbl/dsp/types/convert.hpp> converts. Saturation is the caller's responsibility; interleave_from_float() clamps to +/-1.0 before scaling. The SAI driver outputs raw values with no implicit clamping.

Parameters
tx_bufInterleaved output [L0,R0,L1,R1,...] - fill these
rx_bufInterleaved input [L0,R0,L1,R1,...] - read-only
framesFrame count, at most block_size from AudioConfig

Definition at line 60 of file types.hpp.

Enumeration Type Documentation

◆ SaiLayout

enum class sbl::hal::audio::SaiLayout : uint8_t
strong

SAI block direction layout.

Determines which SAI block is TX (to DAC) and which is RX (from ADC). This is board-level configuration - the codec wiring determines the mapping.

Enumerator
A_TX_B_RX 

Block A = Master TX, Block B = Slave RX (Daisy Seed / AK4556)

A_RX_B_TX 

Block A = Slave RX, Block B = Master TX (Patch SM / PCM3060)

Definition at line 29 of file types.hpp.