Comment on page


High Performance, Cross-Platform Media Device Streaming for Unity Engine

Media Devices Made Easy

NatDevice is a cross-platform media device API. NatDevice simplifies your camera and microphone workflows. First, discover a media device:
// Create a device query for a camera device
var filter = MediaDeviceCriteria.CameraDevice;
var query = new MediaDeviceQuery(filter);
// Get the camera device
var device = query.current as CameraDevice;
// Create a device query for a microphone device
var filter = MediaDeviceCriteria.AudioDevice;
var query = new MediaDeviceQuery(filter);
// Get the microphone device
var device = query.current as AudioDevice;
Then start streaming media data from the device:
// Start streaming camera images
void OnCameraImage (CameraImage cameraImage) {
// Do stuff
// Start streaming audio sample buffers
void OnAudioBuffer (AudioBuffer audioBuffer) {
// Do stuff
From here, you can utilize tons of functionality provided by media devices to build your interactive applications.

Extensive and Lightweight

NatDevice is a lightweight API that provides extensive functionality for using media devices. Features include:
  • Stream the camera preview and microphone audio with very little latency.
  • Support for high resolution camera previews, at full HD and higher where supported.
  • Support for specifying microphone sample rate and channel count.
  • Extensive camera control including hi-res photo capture, flash, focus, manual exposure, white balance, torch, zoom, and orientation support.
  • Extensive metadata including exposure bias, exposure duration, ISO, focal length, and so on.
  • Support for microphones with echo cancellation for karaoke and voice call apps.
  • Integration with NatML, for low-latency, high-performance machine learning on the camera preview or microphone stream.
Make sure to explore the full documentation to get a complete understanding of what the API offers.

Get NatDevice