ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
audio_batch_packet_t Struct Reference

The metadata prefix for a batch of encoded audio samples. batch_count, total_samples, sample_rate, and channels let the receiver allocate or route the batch correctly before it touches the encoded payload. The header is serialized with the packet; the audio bytes remain in the enclosing packet buffer. More...

#include <include/ascii-chat/network/packet/packet.h>

Data Fields

uint32_t batch_count
 Number of audio chunks in this batch (usually AUDIO_BATCH_COUNT = 32).
uint32_t total_samples
 Total audio samples across all chunks (typically 8192).
uint32_t sample_rate
 Sample rate in Hz (e.g., 44100, 48000).
uint32_t channels
 Number of audio channels (1=mono, 2=stereo).

Detailed Description

The metadata prefix for a batch of encoded audio samples. batch_count, total_samples, sample_rate, and channels let the receiver allocate or route the batch correctly before it touches the encoded payload. The header is serialized with the packet; the audio bytes remain in the enclosing packet buffer.

Audio batch packet structure (Packet Type 28)

Contains multiple audio chunks batched together for efficiency. Reduces packet overhead by aggregating 32 chunks (8192 samples) per packet.

Note
Audio samples follow this header in the packet payload.
Format: float samples[total_samples] (interleaved if stereo)
At 44.1kHz, this represents ~186ms of audio per batch.

Definition at line 960 of file packet.h.

Field Documentation

◆ batch_count

uint32_t audio_batch_packet_t::batch_count

Number of audio chunks in this batch (usually AUDIO_BATCH_COUNT = 32).

Definition at line 962 of file packet.h.

Referenced by acip_send_audio_batch(), and audio_parse_batch_header().

◆ channels

uint32_t audio_batch_packet_t::channels

Number of audio channels (1=mono, 2=stereo).

Definition at line 968 of file packet.h.

Referenced by audio_parse_batch_header().

◆ sample_rate

uint32_t audio_batch_packet_t::sample_rate

Sample rate in Hz (e.g., 44100, 48000).

Definition at line 966 of file packet.h.

Referenced by audio_parse_batch_header().

◆ total_samples

uint32_t audio_batch_packet_t::total_samples

Total audio samples across all chunks (typically 8192).

Definition at line 964 of file packet.h.

Referenced by audio_parse_batch_header().


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