*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> audio/alWriteFrames (3d)              


alWriteFrames(3dm)					    alWriteFrames(3dm)

NAME    [Toc]    [Back]

     alWriteFrames - write interleaved sample frames to	an audio port

SYNOPSIS    [Toc]    [Back]

     #include <dmedia/audio.h>

     int alWriteFrames(const ALport port, void *samples, const int framecount)

PARAMETER    [Toc]    [Back]

     port	  is the audio output port to which you	want to	write samples.
		  This is the returned value of	an alOpenPort(3dm) call.

     samples	  is the buffer	containing the samples.

     framecount	  is the number	of sample frames that you want to write	to the
		  audio	port.

DESCRIPTION    [Toc]    [Back]

     alWriteFrames transfers data to an	audio port from	the samples buffer.
     alWriteFrames blocks until	framecount sample frames have been written to
     the port.	If you do not wish to block, make sure that framecount is less
     than the return value of alGetFillable(3dm).

     The format	of the audio data expected by alWriteFrames depends upon the
     configuration of the port.	Each sample can	be an 8-, 16-, or 32-bit
     integer, or a single- or double-precision floating-point value or a block
     of	subcode	data; see alSetSampFmt(3dm), alSetFloatMax(3dm)	and
     alSetWidth(3dm) for a description of how these formats work. By default,
     the sample	format is 16-bit integer (short).

     Within each sample	frame, alWriteFrames expects interleaved data.	The
     number of samples per sample frame	varies according to the	value
     specified by alSetChannels(3dm). By default, the port accepts stereo data
     (2	samples	per frame).

     Note that since an	audio port contains an internal	queue, samples written
     to	the port will not immediately come out the associated audio device or
     devices. alGetFilled(3dm) will indicate how many samples are currently in
     this queue. Also, alGetFrameTime(3dm) and alGetFrameNumber(3dm) provide
     facilities	for precise synchronization of audio and other media.

     In	order to achieve the best possible performance,	alWriteFrames does not
     attempt to	verify that port or samples are	valid. You should make certain
     these values are valid before passing them	as arguments to	alWriteFrames.

EXAMPLE    [Toc]    [Back]

     The following code	fragment opens an audio	output port and	writes a bit
     of	(zero) audio data to it.

									Page 1

alWriteFrames(3dm)					    alWriteFrames(3dm)

	  ALport p;
	  short	buf[10000];   /* 5000 stereo frames */

	  /* open a port with the default configuration	*/
	  p = alOpenPort("alWriteFrames	example","w",0);

	  if (!p) {
	      printf("port open	failed:%s\n", alGetErrorString(oserror()));

	   * Fill our buffer. Really we'd want to do something more interesting
	   * than generating silence.
	  bzero(buf, 10000*sizeof(short));

	  alWriteFrames(p, buf,	5000);	     /*	write 5000 stereo frames */

DIAGNOSTICS    [Toc]    [Back]

     alWriteFrames always returns 0.

NOTES    [Toc]    [Back]

     On	output,	the data from all ports	on the system writing to a particular
     output device will	be mixed together, except in the case of subcode data.
     Because subcode data is treated as	inherently logical information,	no
     amount mathematics	can be applied to perform operations such as mixing.

SEE ALSO    [Toc]    [Back]

     alOpenPort(3dm), alGetFillable(3dm), alGetFilled(3dm),
     alSetChannels(3dm), alSetWidth(3dm), alReadFrames(3dm),
     alZeroFrames(3dm),	alSetConfig(3dm), alSetQueueSize(3dm),
     alSetSampFmt(3dm),	alSetFloatMax(3dm)

									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
alReadFrames IRIX read interleaved sample frames from an audio port
alZeroFrames IRIX write zero-valued sample frames to an audio port
alWriteBuffers IRIX write flexibly interleaved or non-interleaved audio data to an audio port
alGetFilled IRIX return the number of filled sample frames in an audio port
alGetFillable IRIX report the number of unfilled sample frames in an audio port
AFwriteframes IRIX write audio sample frames to a specified track in an audio file
alReadBuffers IRIX read flexibly interleaved or non-interleaved audio data from an audio port
AFreadframes IRIX read sample frames from a specified audio track in an audio file
passthru IRIX pass audio sample data from an input port to an output port
ALgetfillable IRIX (obsolete) report the number of unfilled sample locations in an audio port
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service