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

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


alReadFrames(3dm)					     alReadFrames(3dm)

NAME    [Toc]    [Back]

     alReadFrames - read interleaved sample frames from	an audio port

SYNOPSIS    [Toc]    [Back]

     #include <dmedia/audio.h>

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

PARAMETER    [Toc]    [Back]

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

     samples	  is the buffer	into which you want to read the	samples.

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

DESCRIPTION    [Toc]    [Back]

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

     The format	of the data written into samples 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 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, alReadFrames provides interleaved data. The
     number of samples per sample frame	varies according to the	value
     specified by alSetChannels(3dm). By default, the port provides stereo
     data (2 samples per frame).

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

EXAMPLE    [Toc]    [Back]

     The following code	fragment opens an audio	input port and reads audio
     data from it.

									Page 1

alReadFrames(3dm)					     alReadFrames(3dm)

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

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

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

	  while	(1) {
	      alReadFrames(p, buf, 5000);	  /* read 5000 stereo frames */

	      /* do something here with	the audio data */

DIAGNOSTICS    [Toc]    [Back]

     alReadFrames always returns 0.

SEE ALSO    [Toc]    [Back]

     alOpenPort(3dm), alGetFillable(3dm), alGetFilled(3dm),
     alSetChannels(3dm), alSetWidth(3dm), alWriteFrames(3dm),
     alDiscardFrames(3dm), alSetConfig(3dm), alSetQueueSize(3dm),
     alSetSampFmt(3dm),	alSetFloatMax(3dm)

									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
alWriteFrames IRIX write interleaved sample frames to an audio port
alReadBuffers IRIX read flexibly interleaved or non-interleaved audio data from an audio port
alZeroFrames IRIX write zero-valued sample frames 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
AFreadframes IRIX read sample frames from a specified audio track in an audio file
alWriteBuffers IRIX write flexibly interleaved or non-interleaved audio data to an audio port
AFwriteframes IRIX write audio sample frames to a specified 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