|
RoutineAFILE *AFopnRead (const char Fname[], long int *Nsamp, long int *Nchan, double *Sfreq, FILE *fpinfo) PurposeOpen an audio file for reading DescriptionThis routine opens an audio file for reading. The companion routine AFreadData reads data from the file. Routine AFclose should be used to close the file.This routine reads the audio file header and optionally prints the header information. Several file header formats are supported. For files with no header or an unrecognized header, the file format can be declared by calling routine AFsetNHpar. A banner identifying the audio file and its parameters is printed.
For the fixed point file data representations, read operations return data values as follows. The scaling factor shown below is applied to the data in the file to give an output in the range [-1, +1). data format file data values scaling factor 8-bit mu-law [-32,124, +32,124] 1/32768 8-bit A-law [-32,256, +32,256] 1/32768 8-bit integer [-128, +127] 1/256 16-bit integer [-32,768, +32,767] 1/32768 24-bit integer [-8,388,608, +8,388,607] 1/8388608 32-bit integer [-2,147,483,648, 2,147,483,647] 1/2147483648Floating-point data in the input audio file are scaled by unity.
no. samples file type in header AU yes WAVE yes AIFF or AIFF-C yes NIST SPHERE yes IRCAM no ESPS yes SPPACK yes INRS-Telecom no Cadence SPW no CSL NSP yes Text file no Headerless noNotes: - Some AU audio files and some ESPS audio files do not specify the number of samples. - AIFF/AIFF-C files with a perverse header cannot be opened for non-random access. On encountering an error, the default behaviour is to print an error message and halt execution. Parameters<- AFILE *AFopnRead Audio file pointer for the audio file -> const char Fname[] Character string specifying the file name <- long int *Nsamp Total number of samples in the file (all channels) <- long int *Nchan Number of channels <- double *Sfreq Sampling frequency -> FILE *fpinfo File pointer for printing audio file information. If fpinfo is not NULL, information about the audio file is printed on the stream selected by fpinfo. Author / revisionP. Kabal / Revision 1.4 2005/11/16See AlsoAFclose, AFdReadData, AFfReadData, AFsetNHpar
Visit the GSP FreeBSD Man Page Interface. |