<!--
{
  "documentType" : "article",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/audio",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Audio"
}
-->

# Audio

Configure audio devices that enable the guest operating system to perform audio playback and capture through the host’s audio devices.

## Discussion

If your app can configure an audio input device, you must set an <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSMicrophoneUsageDescription> message in your app’s `Info.plist.` The system uses this description when asking the user’s permission to enable microphone access. If this message isn’t set or the key isn’t present, the system denies microphone access to your app.

> Note:
> To enable VIRTIO sound support in Linux guests, configure sound support in the kernel using the `CONFIG_SND_VIRTIO` kernel parameter.

You can add audio support to your guest with just a few lines of code. The example below shows how to configure a VM to expose a VIRTIO sound device that consists of an audio input and output on the guest that the system bridges to the host machine’s speakers and microphone:

```swift
let outputStream = VZVirtioSoundDeviceOutputStreamConfiguration()
outputStream.sink = VZHostAudioOutputStreamSink()
let outputSoundDevice = VZVirtioSoundDeviceConfiguration()
outputSoundDevice.streams = [outputStream]

let inputStream = VZVirtioSoundDeviceInputStreamConfiguration()
inputStream.source = VZHostAudioInputStreamSource()
let inputSoundDevice = VZVirtioSoundDeviceConfiguration()
inputSoundDevice.streams = [inputStream]

let configuration = VZVirtualMachineConfiguration()
configuration.audioDevices = [outputSoundDevice, inputSoundDevice]
```

## Topics

### Configurations

[`class VZVirtioSoundDeviceConfiguration`](/documentation/Virtualization/VZVirtioSoundDeviceConfiguration)

An object that defines a Virtio sound device configuration.

[`class VZVirtioSoundDeviceOutputStreamConfiguration`](/documentation/Virtualization/VZVirtioSoundDeviceOutputStreamConfiguration)

An object that defines a Virtio sound device output stream configuration.

[`class VZVirtioSoundDeviceInputStreamConfiguration`](/documentation/Virtualization/VZVirtioSoundDeviceInputStreamConfiguration)

A PCM stream of input audio data, such as from a microphone.

[`class VZAudioDeviceConfiguration`](/documentation/Virtualization/VZAudioDeviceConfiguration)

The base class for an audio device configuration.

[`class VZVirtioSoundDeviceStreamConfiguration`](/documentation/Virtualization/VZVirtioSoundDeviceStreamConfiguration)

An object that defines a Virtio sound device stream configuration.

### Audio streams

[`class VZHostAudioOutputStreamSink`](/documentation/Virtualization/VZHostAudioOutputStreamSink)

Host audio output stream sink plays audio to the host system’s default output device.

[`class VZHostAudioInputStreamSource`](/documentation/Virtualization/VZHostAudioInputStreamSource)

The host audio input stream source that provides audio from the host system’s default input device.

[`class VZAudioOutputStreamSink`](/documentation/Virtualization/VZAudioOutputStreamSink)

The base class for an audio output stream sink.

[`class VZAudioInputStreamSource`](/documentation/Virtualization/VZAudioInputStreamSource)

The base class for an audio input stream source.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)