Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hartwork/audio_pump_demo
:studio_microphone: Demos pumping audio from the microphone to headphones/speakers in C99 for PulseAudio, PortAudio and SDL 2
https://github.com/hartwork/audio_pump_demo
audio audio-player audio-processing audio-recorder c c99 microphone microphone-audio-capture microphone-audio-recorder microphone-to-speaker portaudio pulseaudio sdl sdl2
Last synced: about 19 hours ago
JSON representation
:studio_microphone: Demos pumping audio from the microphone to headphones/speakers in C99 for PulseAudio, PortAudio and SDL 2
- Host: GitHub
- URL: https://github.com/hartwork/audio_pump_demo
- Owner: hartwork
- License: gpl-3.0
- Created: 2023-01-03T16:44:49.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T22:41:31.000Z (3 months ago)
- Last Synced: 2025-01-11T15:17:40.972Z (29 days ago)
- Topics: audio, audio-player, audio-processing, audio-recorder, c, c99, microphone, microphone-audio-capture, microphone-audio-recorder, microphone-to-speaker, portaudio, pulseaudio, sdl, sdl2
- Language: C
- Homepage:
- Size: 64.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
[![Build on Linux](https://github.com/hartwork/audio_pump_demo/actions/workflows/linux.yml/badge.svg)](https://github.com/hartwork/audio_pump_demo/actions/workflows/linux.yml)
[![Enforce clang-format](https://github.com/hartwork/audio_pump_demo/actions/workflows/clang-format.yml/badge.svg)](https://github.com/hartwork/audio_pump_demo/actions/workflows/clang-format.yml)# 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:
- one for [PortAudio](https://github.com/PortAudio/portaudio) using asynchronous callbacks —
[`portaudio_async_pump_demo.c`](https://github.com/hartwork/audio_pump_demo/blob/master/portaudio_async_pump_demo.c),
- one for [SDL 2](https://wiki.libsdl.org/SDL2/FrontPage) —
[`sdl2_audio_pump_demo.c`](https://github.com/hartwork/audio_pump_demo/blob/master/sdl2_audio_pump_demo.c),
- one for the [Simple API](https://freedesktop.org/software/pulseaudio/doxygen/simple.html) of PulseAudio —
[`pulseaudio_simple_pump_demo.c`](https://github.com/hartwork/audio_pump_demo/blob/master/pulseaudio_simple_pump_demo.c),
- one for the [Asynchronous API](https://freedesktop.org/software/pulseaudio/doxygen/async.html) of PulseAudio —
[`pulseaudio_async_pump_demo.c`](https://github.com/hartwork/audio_pump_demo/blob/master/pulseaudio_async_pump_demo.c).The code is Software Libre licensed under GPL v3 or later.
# Requirements
- libpulse
- libpulse-simple
- PortAudio
- SDL 2.xe.g.:
```console
# sudo apt install --no-install-recommends --yes -V \
build-essential \
libpulse-dev \
libsdl2-dev \
portaudio19-dev
```# Compilation
```console
# 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