Audio Streaming#

CloudXR supports both downstream server audio and upstream microphone audio. Downstream audio sends audio from the CloudXR Runtime server to the client. Upstream microphone audio sends audio from a compatible client device back to the runtime.

Downstream Audio#

Downstream audio is controlled by the runtime audio-streaming property, and is enabled by default. When audio-streaming is disabled, only video is streamed to the client.

On Windows runtime hosts, the CloudXR Runtime can stream captured system speaker audio without the CloudXR Virtual Audio Driver. Installing the driver adds a dedicated CloudXR speaker output that applications can use to keep their streamed audio separate from other system-wide audio. For example, audio from another desktop application is not mixed into the CloudXR stream when your application writes to the dedicated CloudXR speaker output. For setup details, see CloudXR Virtual Audio Driver.

Microphone Streaming#

Before connecting, the server-side CloudXR Runtime must enable microphone streaming with the mic-streaming property. The runtime audio-streaming property must also remain enabled; if audio-streaming is disabled, microphone streaming is disabled as well.

On Windows runtime hosts, microphone streaming requires the CloudXR Virtual Audio Driver from the CloudXR Runtime SDK to be installed before the runtime starts. The driver provides the dedicated microphone input used by the runtime to receive client microphone audio. For setup details, see CloudXR Virtual Audio Driver.

Use Session.isMicEnabled to read the current microphone state and Session.setMicEnabled(_:) to mute or unmute the microphone during a streaming session:

if !cxrSession.isMicEnabled {
    cxrSession.setMicEnabled(true)
}

Apps that use microphone streaming must include a microphone usage description in Info.plist:

<key>NSMicrophoneUsageDescription</key>
<string>This app streams microphone audio to the connected CloudXR session.</string>

For runtime property details, see CloudXR Runtime Management API.