-
Notifications
You must be signed in to change notification settings - Fork 1
Implementing Audio Transmitter Pipelines
For general information about transmitter pipelines refer to the Transmitter Pipelines section section.
The audio transmitter pipeline, implemented in the ssdk::audio::AudioTransmitterPipeline
class, processes and encodes an audio stream which is then transmitted to subscribed clients over the network. It handles audio conversion and encoding according to fixed configuration options.
The ssdk::audio::AudioTransmitterPipeline
class is the main interface for submitting audio data and managing transmission to clients. Key functionalities include:
-
Audio Buffer Submission: Incoming audio buffers are submitted through the
SubmitInput()
method, initiating processing in the audio pipeline. - Pipeline Processing: Audio buffers are processed through conversion and encoding, prepared for client transmission.
The audio transmitter pipeline includes the following components, which prepare audio for network transmission:
The Audio Converter prepares audio buffers for encoding, performing transformations specified by the configuration options:
- Sample Rate Conversion: Adjusts the sample rate to match the specified encoding requirements.
- Channel Layout Conversion: Converts audio based on the configured layout, such as stereo or mono.
- Format Conversion: Transforms the audio sample format (e.g., PCM) to match the encoder’s input requirements.
The encoder compresses audio data based on the codec selected in the configuration options:
-
Supported Codecs:
- AAC: Provides high-quality compression, compatible with most clients.
- Opus: Efficient at lower bitrates, useful for bandwidth-constrained scenarios.
The ssdk::audio::AudioTransmitterAdapter
object dispatches the encoded audio stream obtained from the ssdk::audio::AudioTransmitterPipeline
object to transmit it to all subscribed receivers. It performs the following functions:
- Client Subscription Management: Maintains a list of clients subscribed to the audio stream, allowing efficient multi-client transmission.
-
Network Transmission:
- SendAudioInit: Initializes the audio stream for each client, sending configuration details for codec, sample rate, and channel layout.
- SendAudioBuffer: Transmits encoded audio buffers to subscribed clients.
-
Buffer Submission: Audio buffers are submitted to
AudioTransmitterPipeline
viaSubmitInput()
. - Sequential Processing: Buffers pass through the Audio Converter for format matching, then proceed to the encoder for compression.
-
Client Transmission:
-
Initialization:
AudioTransmitterAdapter
usesSendAudioInit
to send stream configuration data to each client. -
Buffer Delivery: Encoded audio buffers are delivered using
SendAudioBuffer
, ensuring synchronized delivery across clients.
-
Initialization: