The list below contains descriptions of each of the C-API samples available in the ML Hub. The
README.md files of each example contain instructions on how to build, install and uninstall the example, as well as its expected behavior and GUI.
This sample provides a GUI that will allow users to record their voice and play it back.
Application assets contain two audio PCM files: mary.pcm and ML_AUD_Example.raw. By default tha app will play ML_AUD_Example.raw on the loop. With command line arguments it is possible to specify file to play (--filename), sample rate (--sample_rate) and other parameters. Please see main.cpp for complete list of parameters supported.
This sample demonstrates how to get the battery status.
Camera: Auto Exposure
This sample demonstrates how to use Auto Exposure (AE) related API especially in terms of AE regions.
Camera: Auto Focus
This sample demonstrates how to use auto focus from camera API.
Camera: Mixed Reality
This sample demonstrates how to set up the mixed reality camera and record the video from it using MediaRecorder API.
This sample demonstrates how to preview live feed from a camera and capture images by using multiple streams for a single camera.
This sample demonstrates how to set up camera and stream live feed to a view surface.
This sample demonstrates how to preview live feed from a camera and record it using MediaRecorder API.
This sample demonstrates how to get the state of the Controller and also displays the 6dof position of the Controller.
See the ml_input.h header for the MLInputControllerCallbacks, which can also be used to get events on Controller input.
This sample demonstrates how to setup depth camera and stream live feed to a view surface.
This sample demonstrates how to use the global and segmented dimmer via pixels alpha channel.
This sample demonstrates how to setup eye camera and stream live feed to a view surface.
This example demonstrates the Eye Tracking API by drawing a cube at the gaze convergence point.
Gaze recognition reports ML's best estimate of your oculomotor behavior at a given point in time, metadata about the current behavior, and useful high-precision eye position signals.
The app will draw text to the screen that reports the state of your headset's Perception system and Gaze Recognition system, and current oculomotor behavior.
A cube is rendered in space to indicate the point of vergence.
This sample visualizes output from the Hand Tracking API using simple meshes and text.
The app prints a text box in front of the users eyes that is locked to the head's movement.
This sample renders a cube 1.5m in the negative Z direction from the world origin. The device's world origin is where the device was when it was booted up.
This sample demonstrates how to receive keyboard input callbacks and Controller callbacks in an out of tree application.
This sample demonstrates how to use the bluetooth keyboard or soft keyboard to send commands to an out of tree application.
This sample renders a cube 1.5m in the negative Z direction just to get a graphics window up.
This app will write loop info to logcat and the virtual console. Please refer to the
README.md file for more information.
When properly configured in the GUI, Aruco & QR trackers will receive an AR overlay showing their orientation. This will track multiple markers at the same time.
The GUI provides a simple media player interface. The app will start playing a built-in local media file automatically as soon as it is launched.
This sample demonstrates how to set up the Meshing API.
This sample shows how to request app permissions.
This sample renders planes that are semantically tagged as floors. It shows a pointer coming from the Controller. When you point at a plane and pull the trigger a sphere will be placed at the middle of the plane.
This example demonstrates a simple OpenGL application which can be built and run on host and on device using the Virtual Device and App Simulator systems.
This sample presents usage of the Spatial Anchors API.
System Notification Manager
This sample demonstrates how system notifications can be suppressed and a few examples of how developers can implement their own.
The Sample Notification Manager will only work with certain device SKUs, specifically the call to API
MLSystemNotificationManagerSetNotifications will return
MLResult_IncompatibleSKUon incompatible devices.
The app is controlled by voice. A GUI with a menu shows up with multiple options that the user can say to interact with the app. Please refer to the
README.md file for a full list of commands.
Renders a spinning cube with a triangle on top.
Renders a browser window that will allow you to access the web if the device is connected to the internet. Please refer to the
README.md file for further instructions.
This sample demonstrates how to preview and configure live feed from world camera(s).