Skip to content

[FEATURE] macOS: Implement Audio Capturing using the newer CoreAudio ProcessTap API #110

@kblaschke

Description

@kblaschke

Please confirm the following points:

  • This feature request is NOT for the Android apps in the Play Store
  • I have searched the project page to check if a similar request was already made

Application or Project

projectM Standalone SDL2 Frontend (includes the Steam app)

Is Your Enhancement Related to a Problem?

Currently, the projectMSDL application can only capture audio from external sources like microphones and line-in. It uses the SDL2 CoreAudio wrapper, which only provides very basic access to macOS audio APIs.

Your Suggested Enhancement

Since macOS 14.4, Apple introduces a new API in CoreAudio called "Process Taps", which enables any application to record audio from a specific application once the user allows the application to do so. The API is poorly documented, but there is a GitHub project demonstrating how to use it.

Due to how this API works, it'll require some macOS-specific changes in the UI to select the process to capture from instead of an audio device. Capturing from external sources using the standard CoreAudio API should still be possible though, so this can be implemented as a choice, e.g. a "Capture Source" dropdown or radio button with "External Input" and "Process" choices.

If a process is chosen by the user, the selected process name or executable path should be stored in the configuration file, so the same application to record from can be selected again on the next launch (as the Process Tap API uses the process ID). There should be either a fallback or user message if the selected process isn't available (either on startup or when terminated) to avoid confusion if audio capture suddenly stops working.

Alternative Solutions

No response

Additional Context

(Short) introduction to Taps in Apple's developer docs: https://developer.apple.com/documentation/coreaudio/capturing-system-audio-with-core-audio-taps?language=objc

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions