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.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

DYGK
DYGK

Written by DYGK

SaaS, AI, Bakery Franchise. YC Alumni

Responses (1)

Write a response

This is not working on mac 11.4 version. Please share latest.