Jump to main content

##

# 2.3.2.3.3 Transferring Data

The USB Audio 1.0 Device Driver provides functions to send and receive data.

## Receiving Data

The USB_DEVICE_AUDIO_Read function schedules a data read. When the host transfers data to the device, the Audio 1.0 Function Driver receives the data and invokes the USB_DEVICE_AUDIO_EVENT_READ_COMPLETE event. This event indicates that audio data is now available in the application specified buffer.

The Audio 1.0 Function Driver supports buffer queuing. The application can schedule multiple read requests. Each request is assigned a unique buffer handle, which is returned with the USB_DEVICE_AUDIO_EVENT_READ_COMPLETE event. The application can use the buffer handle to track completion to queued requests. Using this feature allows the application to implement audio buffering schemes such as ping-pong buffering.

## Sending Data

The USB_DEVICE_AUDIO_Write schedules a data write. When the host sends a request for the data, the Audio 1.0 Function Driver transfers the data and invokes the USB_DEVICE_AUDIO_EVENT_WRITE_COMPLETE event.

The Audio 1.0 Function Driver supports buffer queuing. The application can schedule multiple write requests. Each request is assigned a unique buffer handle, which is returned with the USB_DEVICE_AUDIO_EVENT_WRITE_COMPLETE event. The application can use the buffer handle to track completion to queued requests. Using this feature allows the application to implement audio buffering schemes such as ping-pong buffering.