Bonk'd Audio Capture library
  • C 96.6%
  • Makefile 3.4%
Find a file
2022-08-05 09:49:06 -04:00
src v 1.3.2 changed how PortAudio is handled to increase compatibility, untested, needs testing on devices which previously caused errors 2022-08-05 09:49:06 -04:00
test intermediate commit, couple fixes added, debugging changed a bit 2022-05-27 13:50:01 -04:00
.gitignore remove JACK, remove vscode bullshit, hide debug behind defines, may change to taking a function pointer in the future 2022-05-23 08:03:46 -04:00
LIB_LICENSE Initial commit, v 1.0.0 2022-04-21 14:31:07 -04:00
makefile small changes to debug 2022-06-05 22:09:38 -04:00
README.md v 1.3.2 changed how PortAudio is handled to increase compatibility, untested, needs testing on devices which previously caused errors 2022-08-05 09:49:06 -04:00
TEST_PROGRAM_LICENSE Initial commit, v 1.0.0 2022-04-21 14:31:07 -04:00

README

Version : 1.3.2


Licensing

__WARNING:__ This repository uses 2 licenses simultaneously. The library portion of this repo is licensed under the MIT license.
The test program (the audio visualizer) is licensed under GPL V3. See the License files for details on exactly which files
are coverd under what. I have also appended the correct license preamble to each file it applies to, as a general rule
(read the licenses for the actual legal rule) you can use the library as you please, but if you make use of the test program
in your software you MUST license your software under GPL V3 or a stricter GPL license, again, refer to the license files
for the actual legal rule.


Building

Library

Pre-Requisites

Instructions are provided for Linux, if you're on windows, good luck.

This library requires PortAudio, PipeWire* (or not, see notes below this) and ALSA to build. Likely you already have ALSA, but you may
not have PipeWire. Installing/configuring PipeWire is out of the scope of this Readme, refer to your distro's manual for how to do so.
Fedora already includes both PipeWire and ALSA by default starting at (I believe) version 33. All testing was done on Fedora 36.

PortAudio is available in Fedora repos and can be installed with dnf just the same as you'd install anything else.
Check your distros repositories for it, or you can get the source and build it yourself.

*There is a target to build without PipeWire, if you so choose, instructions below include these targets.

Notes on Building:

In the following instructions I mention the `linux` and `linux-test` targets. If your distro does not have pipewire, and
you do not want to deal with installing/configuring, you can alternatively use `linux-no-pw` or `linux-test-no-pw` respectively
to build without pipewire, in these modes only the ALSA interface is available, and the shared object created by this is named
`libbacnopw.so`

Make and Install

clone this repository to wherever you want it, then from the root directory of the repository run:

make linux

to build the library. The output libbac.so file will be in the bin directory created by this command. To install the
library, run:

make install

This will prompt for your sudo password, as it places the libbac.so in /usr/local/lib

Test Program (audio visualizer)

WARNING: If you have epilepsy it's probably best to not use this application, it flashes colors pretty rapidly, you have been warned.

Pre-Requisites

The test program additionally requires SDL2 and FFTW, specifically the 32 bit float version, for information on how to obtain
this library and install it, refer to **[here](https://www.fftw.org/fftw3_doc/Installation-and-Customization.html)** you will need to use the --enable-shared and --enable-float flags when configuring FFTW3.
For SDL2, you can likely install it from your distros package manager.
For Fedora you can find relevant pacakges with

dnf search SDL2

remember to install both the library AND the development headers, both are required.

Make and Run

To make the test program run

make linux-test

the output binary file will be named bac and will be placed in the bin directory. Note this command runs the linux
and install targets and so may ask for your sudo password in order to install the library. To run the audio visualizer run:

cd bin
./bac <args>

There is only a single recognized argument as of version 1.0.0, which is -r to record the audio stream.
WARNING: The audio files produced by recording are MASSIVE as they are RAW AUDIO DATA! They will be output to
test.0 and test.1 and can be played with aplay if you provide the correct rate and channel arguments. (by default
these are 48khz and 2 respectively). Running without arguments does not record audio, and simply runs the audio visualizer.
So put on some good tunes, sit back, and enjoy :)