Skip to content

media sdk audio recorder

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

About AudioRecorder

AudioRecorder captures audio from the workstation microphone and sends it to a camera audio output. The recorder owns the capture pipeline; the application starts and stops the session and handles unhandled exceptions.

AudioRecorder is for output workflows like push-to-talk and intercom. To send PCM audio that the application already owns, use AudioTransmitter instead.

How recording works

AudioRecorder initializes against a logged-on Engine and a camera GUID. The default microphone on the workstation is the audio source; the camera's audio output is the destination.

The logged-on user must also hold the UseAudio privilege for the target camera; without it, Initialize fails.

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

The recorder runs until the application calls StopRecording. The application controls the session duration through push-to-talk, dialog interaction, a time limit, or another mechanism.

AudioRecorder

using Genetec.Sdk.Media;

AudioRecorder recorder = new AudioRecorder();

try
{
    recorder.UnhandledException += OnAudioRecorderException;

    recorder.Initialize(engine, cameraGuid);
    recorder.StartRecording();

    WaitForOperatorToEndAudioSession();

    recorder.StopRecording();
}
finally
{
    recorder.Dispose();
}

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

AudioRecorder members

Member Description
Initialize(IEngine, Guid cameraGuid) Bind the recorder to a 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. Throws NotSupportedException when Media SDK access is not licensed. Throws NoAudioOnCameraException when the camera has no audio output.
StartRecording() Start capturing the workstation microphone and sending it to the camera.
StopRecording() Stop the session.
UnhandledException Event raised when recording encounters an unhandled exception.
Dispose() Release the recorder. Stop recording first if it is running.

NoAudioOnCameraException

Thrown by Initialize when the selected camera does not expose audio output. Show the user that the camera does not support audio output instead of letting the recording session start in an unrecoverable state.

try
{
    recorder.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