0
mirror of https://github.com/torvalds/GuitarPedal.git synced 2026-06-13 21:12:09 +00:00
Files
torvalds-GuitarPedal/Software/usb-audio.h
Linus Torvalds 403b2027ed Allow USB audio input as well as output
As with the USB output - which allows either a wet or dry signal - this
adds USB audio input, and allows it to be mixed in either at the
beginning or the end of the effect chain.

At the beginning of the effect chain, it gets mixed in together with the
incoming guitar signal, and the combined signal will be affected by the
enabled effects.

Alternatively, you can mix it in at the end of the effect chain, and the
USB audio basically just acts as accompaniment to the modified guitar
signal.

From some testing, the compressor and - surprisingly - the pitch shifter
works pretty well for random background audio.

The USB descriptors and callback code are all done by AI again.  I
really don't want to deal with that craziness.  There may be better ways
to handle it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-05-24 16:38:44 -07:00

16 lines
289 B
C

#ifndef USB_AUDIO_H
#define USB_AUDIO_H
#include <stdint.h>
int init_usb(void);
void usb_audio_task(void);
// Provide access to the output buffer
unsigned get_audio_samples(int32_t *buffer, unsigned nr);
// Read one sample from USB audio input
float get_usb_audio_input(void);
#endif