USBIP C library 0.7.0
Virtual USB devices & host drivers over USB/IP
Loading...
Searching...
No Matches
UAC - USB Audio Class 1.0
+ Collaboration diagram for UAC - USB Audio Class 1.0:

Files

file  uac.h
 USB Audio Class 1.0 (UAC1) device class: speaker + microphone, app API.
 

Data Structures

struct  uac_opts
 UAC1 configuration: microphone source + speaker sink callbacks. More...
 

Typedefs

typedef struct uac_audio uac_audio
 One USB Audio function: a single instance of the class on a device.
 

Functions

uac_audiouac_add (usbip_device *dev, const uac_opts *opts)
 Add a UAC1 audio interface (speaker + microphone) to a device.
 
void uac_tone (uint8_t *buf, int frames, uint32_t index)
 Fill a buffer with the built-in synthetic microphone tone.
 

Variables

const usbip_device_class usbip_device_uac
 The UAC1 audio class, for usbip_device_add_class()
 

Detailed Description

Typedef Documentation

◆ uac_audio

typedef struct uac_audio uac_audio

One USB Audio function: a single instance of the class on a device.

Opaque - create one with uac_add() and use the functions below. Distinct from the other classes' handles, so mixing them up is a compile error rather than a misread state block.

Function Documentation

◆ uac_add()

uac_audio * uac_add ( usbip_device dev,
const uac_opts opts 
)

Add a UAC1 audio interface (speaker + microphone) to a device.

Leaves the device class triple at 0/0/0 (UAC1 predates the IAD; the AudioControl header collects the streaming interfaces).

Parameters
devthe device.
optsmicrophone source + speaker sink callbacks (see uac_opts).
Returns
the new function, or NULL on error.

◆ uac_tone()

void uac_tone ( uint8_t *  buf,
int  frames,
uint32_t  index 
)

Fill a buffer with the built-in synthetic microphone tone.

Writes frames mono 16-bit-LE samples of a 440 Hz sine (48 kHz) starting at sample index. Pure integer, so it is byte-identical to the Python uac.tone() - exposed for cross-language parity tests.

Parameters
bufoutput buffer (>= frames * 2 bytes).
framesnumber of mono samples to write.
indexrunning sample counter (the phase origin).

Variable Documentation

◆ usbip_device_uac

const usbip_device_class usbip_device_uac
extern

The UAC1 audio class, for usbip_device_add_class()