Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm wondering how I can get audio input from a jack, process it sample by sample, then send the processed sample to an audio output jack. My plan is to run this on a raspberry pi with a USB soundcard to make a guitar pedal.

If there are any libraries available that can do this (and leave me the freedom of controlling what's in the middle) that would be great. Preferably in python but C/C++ wouldn't be so bad either.

Where do I get started?

EDIT: When I say "process" I want to manipulate the sample values as they come in, then send that same value (or a buffer of them) to the "out" jack. Basically, in pseudo-code:

double sample = input_jack.read();
sample *= 2;  //apply a gain of 2
output_jack.write(sample);
share|improve this question
1  
You might want to define "process it sample by sample". However there are 2 main utilities for doing stuff like this, PulseAudio and JACK –  Patrick Dec 6 '13 at 3:06
add comment

1 Answer

The application I believe you're looking for is called JACK.

excerpt

Have you ever wanted to take the audio output of one piece of software and send it to another? How about taking the output of that same program and send it to two others, then record the result in the first program? Or maybe you're a programmer who writes real-time audio and music applications and who is looking for a cross-platform API that enables not only device sharing but also inter-application audio routing, and is incredibly easy to learn and use? If so, JACK may be what you've been looking for.

JACK is system for handling real-time, low latency audio (and MIDI). It runs on GNU/Linux, Solaris, FreeBSD, OS X and Windows (and can be ported to other POSIX-conformant platforms). It can connect a number of different applications to an audio device, as well as allowing them to share audio between themselves. Its clients can run in their own processes (ie. as normal applications), or can they can run within the JACK server (ie. as a "plugin"). JACK also has support for distributing audio processing across a network, both fast & reliable LANs as well as slower, less reliable WANs.

JACK was designed from the ground up for professional audio work, and its design focuses on two key areas: synchronous execution of all clients, and low latency operation. More background information is available.

I'd take a look at the list of applications that you can use with JACK, and pick one that looks like what you're after. You can take a look at all these JACK compatible applications on this list:

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.