3.3.4.40 USB_HOST_AUDIO_V1_StreamRead Function

C

USB_HOST_AUDIO_V1_RESULT USB_HOST_AUDIO_V1_StreamRead(
    USB_HOST_AUDIO_V1_STREAM_HANDLE streamHandle, 
    USB_HOST_AUDIO_V1_STREAM_TRANSFER_HANDLE * transferHandle, 
    void * source, 
    size_t length
);

Summary

This function schedules an audio stream read request for the specified audio stream. A USB_HOST_AUDIO_V1_STREAM_EVENT_READ_COMPLETE event is generated when this request is completed. USB_HOST_AUDIO_V1_STREAM_EVENT_READ_COMPLETE_DATA returns the status and request handle of the request.

Precondition

The audio stream should have been opened and enabled. The direction of the audio stream should be USB_HOST_AUDIO_V1_DIRECTION_IN.

Parameters

Parameters Description
streamHandle Handle to the Audio v1.0 stream
transferHandle Handle to the stream read transfer request
source Pointer to the buffer containing data to be read from the device
length Amount of data to read (in bytes)

Returns

  • USB_HOST_AUDIO_V1_RESULT_SUCCESS - The operation was successful
  • USB_HOST_AUDIO_V1_RESULT_HANDLE_INVALID - The specified audio stream does not exist
  • USB_HOST_AUDIO_V1_RESULT_FAILURE - An unknown failure occurred

Remarks

None.