Skip to content

Commit

Permalink
config(apple): generate two audio devices for input/output
Browse files Browse the repository at this point in the history
Comment from #4409 says one device does not work on Intel.
  • Loading branch information
osy committed Oct 10, 2022
1 parent 0e36a65 commit 4a8ddf9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Configuration/UTMAppleConfigurationVirtualization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,15 @@ extension UTMAppleConfigurationVirtualization {
}
if #available(macOS 12, *) {
if hasAudio {
let audioConfiguration = VZVirtioSoundDeviceConfiguration()
let audioInputConfiguration = VZVirtioSoundDeviceConfiguration()
let audioInput = VZVirtioSoundDeviceInputStreamConfiguration()
audioInput.source = VZHostAudioInputStreamSource()
audioInputConfiguration.streams = [audioInput]
let audioOutputConfiguration = VZVirtioSoundDeviceConfiguration()
let audioOutput = VZVirtioSoundDeviceOutputStreamConfiguration()
audioOutput.sink = VZHostAudioOutputStreamSink()
audioConfiguration.streams = [audioInput, audioOutput]
vzconfig.audioDevices = [audioConfiguration]
audioOutputConfiguration.streams = [audioOutput]
vzconfig.audioDevices = [audioInputConfiguration, audioOutputConfiguration]
}
if hasKeyboard {
vzconfig.keyboards = [VZUSBKeyboardConfiguration()]
Expand Down

0 comments on commit 4a8ddf9

Please sign in to comment.