Skip to content

media sdk audio transmitter

Andre Lafleur edited this page Oct 8, 2026 · 6 revisions

About AudioTransmitter

AudioTransmitter sends raw PCM audio buffers to a camera audio output. The application supplies the audio data; the transmitter handles framing and delivery.

AudioTransmitter is for output. To receive audio from a camera, use VideoSourceFilter; AudioVideoSourceFilter raises decoded audio events. For recorded audio, use PlaybackStreamReader.

To capture and send the workstation microphone, use AudioRecorder instead.

How transmission works

AudioTransmitter initializes against a connected Engine and a camera GUID. After StartTransmitting, the application calls QueueBuffer(data, offset, size) to push PCM bytes. Use 8 kHz, 16-bit, single-channel PCM audio. The transmitter accumulates small queued buffers until it has enough data to send, and splits oversized queued buffers into payloads of IdealPayloadSize.

If the camera does not expose audio output, Initialize throws NoAudioOnCameraException. If the engine is not connected to a Directory or the camera is not native, Initialize throws InvalidOperationException. If the system license does not allow Media SDK access, it throws NotSupportedException.

AudioTransmitter

using Genetec.Sdk.Media;

AudioTransmitter transmitter = new AudioTransmitter();

try
{
    transmitter.UnhandledException += OnAudioTransmitterException;

    transmitter.Initialize(engine, cameraGuid);

    await transmitter.StartTransmitting();

    transmitter.QueueBuffer(data, offset, size);

    transmitter.StopTransmitting();
}
finally
{
    transmitter.Dispose();
}

Initialize has an overload that accepts a client-subnet GUID for media route selection. Pass Guid.Empty when the default route is acceptable.

AudioTransmitter members

Member Description
Initialize(IEngine, Guid cameraGuid) Bind the transmitter to a native camera. The engine must be connected to a Directory, and the system license must allow Media SDK access. Throws InvalidOperationException when the engine is not connected or the camera is not native. Throws NotSupportedException when Media SDK access is not licensed. Throws NoAudioOnCameraException when the camera has no audio output.
StartTransmitting() Start the transmission session. Returns a Task.
QueueBuffer(byte[] data, int offset, int size) Queue the specified PCM bytes for transmission. The method copies the bytes before returning, so you can reuse or modify the source array after the call returns.
StopTransmitting() Stop the session.
IdealPayloadSize Recommended buffer size in bytes. The transmitter accumulates smaller buffers and splits larger ones.
UnhandledException Event raised when transmission encounters an unhandled exception.
Dispose() Release the transmitter. Stop transmission first if it is running.

NoAudioOnCameraException

Thrown by Initialize when the selected camera does not expose audio output. Treat it as a camera capability problem; the application cannot recover by adjusting buffer sizes or transmission parameters.

try
{
    transmitter.Initialize(engine, cameraGuid);
}
catch (NoAudioOnCameraException ex)
{
    ShowAudioOutputUnavailable(ex.Message);
}

See also

Platform SDK

Plugin SDK

Workspace SDK

Media SDK

Macro SDK

Web SDK

Synergis RIO

Media Gateway

Genetec Web Player

Clone this wiki locally