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

  man pages->IRIX man pages -> audiofile/afInitDataOffset (3d)              
Title
Content
Arch
Section
 

Contents


afInitDataOffset(3dm)					 afInitDataOffset(3dm)


NAME    [Toc]    [Back]

     afInitDataOffset, afInitFrameCount	- initialize the audio data byte
     offset / frame count in an	AFfilesetup for	a specified raw-format audio
     track

SYNOPSIS    [Toc]    [Back]

     #include <dmedia/audiofile.h>

     void afInitDataOffset(AFfilesetup setup, int track, AFfileoffset offset)

     void afInitFrameCount(AFfilesetup setup, int track, AFframecount count)

PARAMETER    [Toc]    [Back]

     setup    is an AFfilesetup	structure, previously created by a call	to
	      afNewFileSetup(3dm).

     track    is an integer which identifies an	audio track in setup.

	      Since all	currently supported file formats contain only one
	      audio track, the value AF_DEFAULT_TRACK should always be used
	      here.

     offset   is a positive value which	specifies the offset in	bytes for the
	      audio data associated with track.	 The data type AFfileoffset is
	      large enough to hold any data offset allowed by the filesystem.

     count    is a positive value which	specifies the number of	frames of
	      audio data to be associated with track.  The data	type
	      AFframecount is large enough to hold any frame count allowed by
	      the filesystem.

DESCRIPTION    [Toc]    [Back]

     afInitDataOffset()	initializes the	audio data offset in an	AFfilesetup
     structure for an audio track.

     afInitFrameCount()	initializes the	audio frame count in an	AFfilesetup
     structure for an audio track.

     When a file is opened for reading or writing by passing setup to
     afOpenFile(3dm), the track	will be	configured to read or write data using
     the data offset and/or frame count	specified.  These routines may only be
     used when reading or writing raw (headerless) audio files.	All non-raw
     audio formats have	a fixed	data offset determined by their	headers.
     These routines are	also useful for	reading	audio file formats which are
     not supported by the Audio	File Library, but whose	format is known	to a
     particular	application.  If the application can supply all	the necessary
     parameters	(data offset, frame count, sample format, rate,	and channel
     count), then the file can be read as a raw	file via afReadFrames().







									Page 1






afInitDataOffset(3dm)					 afInitDataOffset(3dm)



EXAMPLE
     Attempt to	read a raw audio file with a known data	offset of 60 bytes and
     a known frame count of 1000.  All other parameters	default	to the default
     AIFF(4) file values: 16-bit 2's complement, 1 channel, 44.1kz rate.

     #include <dmedia/audiofile.h>

     main()
     {
	 AFfilesetup setup;
	 AFfilehandle inHandle;
	 short buf[1024];
	 AFframeoffset fileOffset = 60;
	 AFframecount frameCount = 1000;

	 /* create setup */

	 setup = afNewFileSetup();

	 /* configure as raw file with given offset and	frame count */

	 afInitFileFormat(setup, AF_FILE_RAWDATA);
	 afInitDataOffset(setup, AF_DEFAULT_TRACK, fileOffset);
	 afInitFrameCount(setup, AF_DEFAULT_TRACK, frameCount);

	 /* open the file */

	 inHandle = afOpenFile("myrawsoundfile", "r", setup);

	 /* read all the frames	*/

	 afReadFrames(inHandle,	AF_DEFAULT_TRACK, buf, frameCount);
     }

SEE ALSO    [Toc]    [Back]

      
      
     afNewFileSetup(3dm), afOpenFile(3dm), afWriteFrames(3dm),
     afSetVirtualSampleFormat(3dm), afGetVirtualSampleFormat(3dm),


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
afInitFormatParams IRIX initialize the audio data format in an AFfilesetup for a specified audio track via dmParams
AFinitsampfmt IRIX initialize the audio data format in an AFfilesetup for a specified audio track
dmMPEG1AudioEncode IRIX Compresses a single block of audio data using MPEG1 audio compression algorithm.
afSetVirtualFormatParams IRIX set/get the virtual audio data format in an AFfilehandle for a specified audio track via dmParams
afGetFormatParams IRIX get the audio data format in an AFfilehandle for a specified audio track via dmParams
datframe IRIX structure of a frame of audio data on Digital Audio Tape (DAT)
alNewEvent IRIX create and initialize an audio ALevent structure
ALnewconfig IRIX create and initialize an audio ALconfig structure
alNewConfig IRIX create and initialize an audio ALconfig structure
AFinitfilefmt IRIX initialize the audio file format type in an AFfilesetup structure
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service