USBIP C library 0.7.0
Virtual USB devices & host drivers over USB/IP
Loading...
Searching...
No Matches
uac_opts Struct Reference

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

#include <classes/uac.h>

Data Fields

int(* mic_source )(void *user, uint8_t *buf, int frames, uint32_t index)
 Microphone source (optional).
 
void(* spk_sink )(void *user, const uint8_t *data, int len)
 Speaker sink (optional).
 
void(* on_event )(void *user, const char *text)
 Human-readable log hook (optional).
 
void * user
 Opaque pointer passed to the callbacks above.
 

Detailed Description

UAC1 configuration: microphone source + speaker sink callbacks.

Field Documentation

◆ mic_source

int(* uac_opts::mic_source) (void *user, uint8_t *buf, int frames, uint32_t index)

Microphone source (optional).

Fill buf with mono 16-bit-LE capture samples; return < 0 to use the built-in 440 Hz synthetic tone.

Parameters
userthe user pointer.
bufoutput buffer (frames × 2 bytes).
framesnumber of mono samples requested.
indexrunning mono-sample counter (the phase origin).
Returns
bytes written, or < 0 for the built-in tone.

◆ spk_sink

void(* uac_opts::spk_sink) (void *user, const uint8_t *data, int len)

Speaker sink (optional).

Receives stereo 16-bit-LE playback audio the host pushed to the speaker (once per isochronous OUT transfer).

Parameters
userthe user pointer.
datathe PCM bytes.
lennumber of bytes in data.

◆ on_event

void(* uac_opts::on_event) (void *user, const char *text)

Human-readable log hook (optional).

Parameters
userthe user pointer.
texta NUL-terminated description.

◆ user

void* uac_opts::user

Opaque pointer passed to the callbacks above.


The documentation for this struct was generated from the following file: