Skip to content

🎙️ Demos pumping audio from the microphone to headphones/speakers in C99 for PulseAudio, PortAudio and SDL 2

License

Notifications You must be signed in to change notification settings

hartwork/audio_pump_demo

Repository files navigation

Build on Linux Enforce clang-format

Audio pump demo (for PulseAudio, PortAudio and SDL 2)

This repository demos pumping audio from the default input device (e.g. a microphone) to the default output device (e.g. headphones/speakers) in C99. In other words: this demo records audio, and it plays back audio.

There are four editions:

The code is Software Libre licensed under GPL v3 or later.

Requirements

  • libpulse
  • libpulse-simple
  • PortAudio
  • SDL 2.x

e.g.:

# sudo apt install --no-install-recommends --yes -V \
    build-essential \
    libpulse-dev \
    libsdl2-dev \
    portaudio19-dev

Compilation

# make CFLAGS='-O2 -pipe' -j
# ./portaudio_async_pump_demo
# ./pulseaudio_async_pump_demo
# ./pulseaudio_simple_pump_demo
# ./sdl2_audio_pump_demo

Hotkeys

  • Ctrl+C — exit