How to record from mic using Swift on OS X

DYGK
1 min readJun 6, 2018

--

Most of the tutorials on recording and playing voice using AVFoundation in Swift focuses on iOS. The problem with this is that iOS utilizes AVAudioSession, which acts as an intermediary between your iOS app and the operating system, that is not supported on OS X.

Photo by Blake Connally on Unsplash

This is a short GIST about how to record, save to file, and play audio input from OS X’s default mic under 100 lines of code.

Reference: https://github.com/jgorset/Recorder which I believe works well in iOS.

--

--

DYGK
DYGK

Written by DYGK

SaaS, AI, Bakery Franchise. YC Alumni

Responses (1)