Repository navigation
media sdk audio recorder
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.
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.
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.
| 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. |
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);
}- About AudioTransmitter: Sending raw PCM audio buffers to a camera audio output.
- About VideoSourceFilter: Headless playback that delivers decoded video and audio frames to your code.
- Overview
- Connecting to Security Center
- SDK certificates
- Referencing SDK assemblies
- ASP.NET hosting
- SDK compatibility
- Migrating to modern .NET
- Entities
- Entity cache
- Entity loading, cache, and query options
- Detecting entity changes
- Entity change event reference
- Transactions
- Security Center events
- Actions
- Security Desk
- Custom events
- Event-to-actions
- Managing macros
- ReportManager
- ReportManager query reference
- Access control raw events
- DownloadAllRelatedData and StrictResults
- Privileges
- Partitions
- Entity write restrictions
- About custom fields
- About video
- About cameras
- Enrolling a video unit
- Ingesting third-party video
- Archiver and auxiliary archiver roles
- Archive transfer
- About access control
- About cardholders and credentials
- About doors, areas, elevators, and access points
- About access rules and schedules
- About access control units and interface modules
- Enrolling an access control unit
- Door templates
- Visitors
- Mobile credentials
- About threat levels
- About alarms
- About incidents
- Maps
- Logging
- Overview
- Localization
- Certificates
- Lifecycle
- Threading
- State management
- Configuration
- Restricted configuration
- Events
- Queries
- Request manager
- Database
- Entity ownership
- Engine extensions
- Entity mappings
- Server management
- Custom privileges
- Custom entity types
- Resolving non-SDK assemblies
- Deploying plugins
- Modern .NET support
- Overview
- Localization
- Certificates
- Creating modules
- Tasks
- Pages
- Components
- Tile extensions
- Services
- Contextual actions
- Custom actions
- Options extensions
- Configuration pages
- Monitors
- Shared components
- Commands
- Extending events
- Map extensions
- Timeline providers
- Image extractors
- Credential encoders
- Credential readers
- Cardholder fields extractors
- Badge printers
- Content builders
- Dashboard widgets
- Incidents
- Logon providers
- Pinnable content builders
- Custom report pages
- Overview
- Getting started
- Media file formats
- MediaPlayer
- VideoSourceFilter
- MediaExporter
- MediaFile
- G64 converters
- FileCryptingManager
- PlaybackSequenceQuerier
- PlaybackStreamReader
- OverlayFactory
- PtzCoordinatesManager
- AudioTransmitter
- AudioRecorder
- AnalogMonitorController
- Camera blocking
- Overview
- Getting started
- Referencing entities
- Entity operations
- About access control in the Web SDK
- About video in the Web SDK
- Users and user groups
- Partitions
- Custom fields
- Custom card formats
- Actions
- Events and alarms
- Incidents
- Reports
- Tasks
- Macros
- Custom entity types
- System endpoints
- Performance guide
- Reference
- Endpoints
- Constants
- Enumerations
- Under the hood
- Troubleshooting