PortAudio

This Godot module provides wrapper methods for the PortAudio library, enabling low-latency audio processing and direct control over audio input and output within Godot Engine. It offers flexibility in choosing audio drivers and managing audio buffers, making it suitable for audio tools and rhythm games.

https://github.com/sebastian-heinz/portaudio

Preview Images

Preview
Preview
Preview

PortAudio Godot Module: Low-Latency Audio

This module integrates the PortAudio library with the Godot Engine, offering developers direct control over audio input and output streams. This integration allows for lower latency audio processing, which is particularly beneficial for music rhythm games and audio tools.

Key Features

  • Direct Audio Control: Manage audio buffers and choose audio drivers at runtime.
  • Low Latency: Achieve lower latency compared to standard Godot audio nodes, especially when using C++ audio callbacks.
  • Flexibility: Not tied to any specific Godot node; control audio from anywhere in your project.
  • Driver Selection: Choose the appropriate audio driver based on the target system and available APIs (ASIO, WASAPI, etc.).

Usage

The module provides a singleton class with wrapper methods for PortAudio functions. You can use GDScript or C++ to interact with the audio streams. The included PortAudioTestNode helps enumerate available host APIs and devices. Remember to fill the audio buffer correctly in each callback to avoid audio artifacts.

Considerations

Using GDScript for audio callbacks introduces performance overhead and latency. For optimal low-latency performance, consider using C++ for audio processing. Ensure that the audio callback function executes quickly to prevent slow or crackling audio.

Supported Drivers

The module supports various audio drivers across different platforms, including ASIO, WASAPI, and ALSA. Driver compatibility may vary depending on the platform and required dependencies (e.g., ASIO drivers need to be installed separately).

Resource Details

library

sebastian-heinz



4.x