Repository navigation
media sdk audio transmitter
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.
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.
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.
| 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. |
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);
}- About AudioRecorder: Capturing the workstation microphone and sending it to a camera.
- 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