DALIB(3)

NAME
da_write - write on the device associated with a DAT descriptor

SYNOPSIS
#include dataudiolib.h

int
da_write(int datfd ,unsigned char* data ,int size )

DESCRIPTION
The da_write() function writes a chunk of audio data on the device specified by datfd. The function will convert the audiodata into the DAT format and write it to the device/file/stream associated with datfd . The resulting data is being buffered.
This function advances the subcode written automatically depending on the parameters specified using da_control(3) or as loaded from the saved state.

PARAMETERS

  Input Parameters

datfd
    A filedescriptor returned by da_open or da_init.

data
    Contains the audiodata consisting of 16 bit linear encoded stereo samples (alternating left and right channel).

size
    The size of the audiodata.

RETURN VALUE
This function returns the number of bytes used from data.
When an error condition arises, this routine returns -1 and sets errno to indicate the reason for the error. Possible values of errno are:

EINVAL
    The filedescriptor is invalid.

other
    All errnos that can be returned by write(2) .

USAGE EXAMPLE

Write 4096 bytes of audiodata.

		unsigned char	data[4096];
		int		res;
		/* fill data */
		res=da_write(datfd,data,4096);
		if (res==-1) {
			perror("da_write");
		}

SEE ALSO
da_intro(3),da_read(3)

AUTHOR
Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>