1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
|
<HTML>
<HEAD>
<TITLE>TSP (libtsp/AF) - AFsetNH</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFACD">
<H2>AFsetNH</H2>
<HR>
<H4>Routine</H4>
<DL>
<DT>
void AFsetNH (const char String[])
<DT>
struct AF_NHpar *AFgetNH (void)
</DL>
<H4>Purpose</H4>
<DL>
<DT>
Set defaults for headerless audio files
<DT>
Get defaults for headerless audio files
</DL>
<H4>Description</H4>
This routine sets or gets default audio file data parameters. These
parameters are used for files with unrecognized (non-standard) headers or
files with no headers (raw audio files). The AFsetNH routine must be called
before opening the file with AFopenRead. The parameters for AFsetNH are
determined from an input string which consists of a list of parameters
separated by commas. The form of the list is
<PRE>
"Format, Start, Sfreq, Swapb, Nchan, ScaleF"
</PRE>
<DL>
<DT>
Format: File data format
<DD>
The lowercase versions of these format specifiers cause a headerless
file to be accepted only after checking for standard file headers; the
uppercase versions cause a headerless file to be accepted without
checking the file header.
<PRE>
"undefined" - Headerless files will be rejected
"mu-law8" or "MU-LAW8" - 8-bit mu-law data
"A-law8" or "A-LAW8" - 8-bit A-law data
"unsigned8" or "UNSIGNED8" - offset-binary 8-bit integer data
"integer8" or "INTEGER8" - two's-complement 8-bit integer data
"integer16" or "INTEGER16" - two's-complement 16-bit integer data
"float32" or "FLOAT32" - 32-bit floating-point data
"float64" or "FLOAT64" - 64-bit floating-point data
"text" or "TEXT" - text data
</PRE>
<DT>
Start: byte offset to the start of data (integer value)
<DT>
Sfreq: sampling frequency in Hz (floating-point number)
<DT>
Swapb: Data byte swap parameter
<DD>
<PRE>
"native" - no byte swapping
"little-endian" - file data is in little-endian byte order and will
be swapped if the current host uses big-endian byte order
"big-endian" - data is in big-endian byte order and will be
swapped swapped if the current host uses little-endian byte order
"swap" - swap the data bytes
</PRE>
<DT>
Nchan: number of channels
<DD>
The data consists of interleaved samples from Nchan channels
<DT>
ScaleF: Scale factor
<DD>
Scale factor applied to the data from the file
</DL>
The default values correspond to the following string
<PRE>
"undefined, 0, 8000., native, 1, 1.0"
</PRE>
<P>
Leading and trailing white-space (as defined by isspace) is removed from
each item. In the input string, any of the parameters may be omitted, in
which case whatever value has been previously set remains in effect for
that parameter. The string ",512, 10000." would set the Start and Sfreq
parameters and leave the other parameters undisturbed.
<P>
If the input string contains has a leading '$', the string is assumed to
specify the name of an environment variable after the '$'. This routine uses
the value of this environment variable to determine the parameters. If this
routine is called as AFsetNH("$NOHEADER_AUDIOFILE"), this routine would look
for the parameter string in environment variable NOHEADER_AUDIOFILE.
<P>
The procedure AFgetNH is used internally by the audio file routines. It
returns a pointer to a structure of type AF_NHpar.
<H4>Parameters</H4>
<DL>
<DT>
AFsetNH:
<DT>
-> const char String[]
<DD>
String containing the list of parameters for headerless files or the name
of an environment variable (with a leading $)
<DT>
AFgetNH:
<DT>
<- struct AF_NHpar *AFgetNH
<DD>
Structure with file data parameters
<PRE>
int Accept - Headerless flag
int Format - Data format
long int Start - Offset in bytes to the start of data
float Sfreq - Sampling frequency
int Swapb - Byte swap flag
long int Nchan - Number of channels
float ScaleF - Scale factor
</PRE>
</DL>
<H4>Author / revision</H4>
P. Kabal Copyright (C) 1996
/ Revision 1.32 1996/11/26
<H4>See Also</H4>
<A HREF="AFopenRead.html">AFopenRead</A>
<P>
<HR>
Main Index <A HREF="../libtsp.html">libtsp</A>
</BODY>
</HTML>
|