AVAudioEngine. Select input device on macOS

Hello! I'm use AVFoundation for preview video and audio from selected device, and I try use AVAudioEngine for preview audio in real-time, but I can't or I don't understand how select input device? I can hear only my microphone in real-time

So far, I'm using AVCaptureAudioPreviewOutput for in real-time hear audio, but I think has delay.

On iOS works easy with AVAudioEngine, but on macOS bruh...

Answered by Media Engineer in 828189022

Hi ManyLattice, On MacOS you have more choices for audio preview than on iOS. You can source your audio (mic) from AVCaptureDevice+AVCaptureSession and preview it using AVCaptureAudioPreviewOutput, or you could just use AVCaptureAudioDataOutput as a provider of audio samples to your AVAudioEngine if you want to play back using a common interface between iOS and macOS.

Accepted Answer

Hi ManyLattice, On MacOS you have more choices for audio preview than on iOS. You can source your audio (mic) from AVCaptureDevice+AVCaptureSession and preview it using AVCaptureAudioPreviewOutput, or you could just use AVCaptureAudioDataOutput as a provider of audio samples to your AVAudioEngine if you want to play back using a common interface between iOS and macOS.

AVAudioEngine. Select input device on macOS
 
 
Q