AWriteAFileHeader(3X)
NAME
AWriteAFileHeader − write a header for an audio file
SYNOPSIS
#include <audio/Alib.h>
long
AWriteAFileHeader (
Audio *audio,
char *pathname,
AFileFormat file_format ,
AudioAttributes *audio_attributes,
long *status_return
);
DESCRIPTION
AWriteAFileHeader() opens the specified file (truncating it to zero if it exists, or creating it if it does not exist), and writes a file header suitable for the specified file format and attributes.
audio specifies the Audio structure associated with this connection.
pathname the pathname of the audio data file for which a header will be written.
file_format specifies format of the file for which the header will be written. Must be a valid format (not AFFUnknown).
audio_attributes specifies attributes of the audio file for which the header will be written. Must be a complete audio attributes structure. The header’s data length will be written as zero if the duration field of audio_attributes is set to ATTFullLength.
status_return receives the returned status of the operation, unless it is set to NULL.
RETURN VALUE
Upon successful completion, AWriteAFileHeader() returns the length of the file header.
ERRORS
If status_return is not set to NULL, one of the following is returned in status_return:
0 AENoError
1 AESystem Call
6 AEBadFileFormat
7 AEBadDataFormat
17 AEOutOFMemory
EXAMPLE
The following example writes a file header to the file /myhome/a_dir/a_file.au.
AFileFormat file_fmt; /* file format */
Audio * audio; /* audio connection ∗/
long header_len; /* length of header */
AudioAttributes attribs; /* previously defined attributes */
long status; /* status */
.
.
.
/* write a Sun/NeXT file header to /myhome/a_dir/a_file */
char fname[] = /myhome/a_dir/a_file.au ;
file_fmt = AFFSun;
header_len = AWriteAFileHeader(audio, fname, file_fmt,
&attribs, &status);
DEPENDENCIES
This function belongs to the Audio Library of functions that manage connections to an audio server. The audio server must run on a system that has audio hardware. To find out whether or not your system has audio hardware, refer to the hardware manual that accompanies your system.
AUTHOR
AWriteAFileHeader() was developed by HP.
SEE ALSO
Using the Audio Application Program Interface.
Hewlett-Packard Company — HP-UX Release 9.0: August 1992