| 1 |
'\" t |
| 2 |
.\" Title: afOpenFile |
| 3 |
.\" Author: [see the "AUTHOR" section] |
| 4 |
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/> |
| 5 |
.\" Date: 03/06/2013 |
| 6 |
.\" Manual: \ \& |
| 7 |
.\" Source: Audio File Library 0.3.6 |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "AFOPENFILE" "3" "03/06/2013" "Audio File Library 0\&.3\&.6" "\ \&" |
| 11 |
.\" ----------------------------------------------------------------- |
| 12 |
.\" * Define some portability stuff |
| 13 |
.\" ----------------------------------------------------------------- |
| 14 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 15 |
.\" http://bugs.debian.org/507673 |
| 16 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 17 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 18 |
.ie \n(.g .ds Aq \(aq |
| 19 |
.el .ds Aq ' |
| 20 |
.\" ----------------------------------------------------------------- |
| 21 |
.\" * set default formatting |
| 22 |
.\" ----------------------------------------------------------------- |
| 23 |
.\" disable hyphenation |
| 24 |
.nh |
| 25 |
.\" disable justification (adjust text to left margin only) |
| 26 |
.ad l |
| 27 |
.\" ----------------------------------------------------------------- |
| 28 |
.\" * MAIN CONTENT STARTS HERE * |
| 29 |
.\" ----------------------------------------------------------------- |
| 30 |
.SH "NAME" |
| 31 |
afOpenFile \- open an audio file and create a file handle structure used for subsequent calls to the Audio File Library |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.sp |
| 34 |
.nf |
| 35 |
#include <audiofile\&.h> |
| 36 |
.fi |
| 37 |
.sp |
| 38 |
.nf |
| 39 |
AFfilehandle afOpenFile(const char *path, const char *mode, |
| 40 |
AFfilesetup setup); |
| 41 |
.fi |
| 42 |
.SH "PARAMETERS" |
| 43 |
.sp |
| 44 |
\fIpath\fR is the path to the file to be opened\&. |
| 45 |
.sp |
| 46 |
\fImode\fR specifies a mode for opening the file: "r" for reading or "w" for writing\&. |
| 47 |
.sp |
| 48 |
\fIsetup\fR is an AFfilesetup created by \fBafNewFileSetup\fR(3)\&. This value is ignored for files opened for reading except when the file format is AF_FILE_RAWDATA\&. |
| 49 |
.SH "RETURN VALUE" |
| 50 |
.sp |
| 51 |
Upon success, afOpenFile returns a valid AFfilehandle which can be used in subsequent calls to the Audio File Library\&. Upon failure, afOpenFile returns NULL and generates an error\&. |
| 52 |
.sp |
| 53 |
\fBafCloseFile\fR(3) is used to close the file when it is no longer needed\&. |
| 54 |
.SH "ERRORS" |
| 55 |
.sp |
| 56 |
afOpenFile can produce the following errors: |
| 57 |
.PP |
| 58 |
AF_BAD_OPEN |
| 59 |
.RS 4 |
| 60 |
A call to |
| 61 |
open |
| 62 |
failed\&. |
| 63 |
.RE |
| 64 |
.PP |
| 65 |
AF_BAD_READ |
| 66 |
.RS 4 |
| 67 |
A call to |
| 68 |
read |
| 69 |
failed |
| 70 |
.RE |
| 71 |
.PP |
| 72 |
AF_BAD_WRITE |
| 73 |
.RS 4 |
| 74 |
A call to |
| 75 |
write |
| 76 |
failed\&. |
| 77 |
.RE |
| 78 |
.PP |
| 79 |
AF_BAD_LSEEK |
| 80 |
.RS 4 |
| 81 |
A call to |
| 82 |
lseek |
| 83 |
failed\&. |
| 84 |
.RE |
| 85 |
.PP |
| 86 |
AF_BAD_MALLOC |
| 87 |
.RS 4 |
| 88 |
Memory allocation failed\&. |
| 89 |
.RE |
| 90 |
.PP |
| 91 |
AF_BAD_FILEFMT |
| 92 |
.RS 4 |
| 93 |
|
| 94 |
setup |
| 95 |
specifies a file format which is unsupported for |
| 96 |
mode\&. |
| 97 |
.RE |
| 98 |
.PP |
| 99 |
AF_BAD_SAMPFMT |
| 100 |
.RS 4 |
| 101 |
The file\(cqs sample format is not supported\&. |
| 102 |
.RE |
| 103 |
.PP |
| 104 |
AF_BAD_WIDTH |
| 105 |
.RS 4 |
| 106 |
The file\(cqs sample width is not supported\&. |
| 107 |
.RE |
| 108 |
.PP |
| 109 |
AF_BAD_RATE |
| 110 |
.RS 4 |
| 111 |
The file\(cqs sample rate is not supported\&. |
| 112 |
.RE |
| 113 |
.PP |
| 114 |
AF_BAD_CHANNELS |
| 115 |
.RS 4 |
| 116 |
The number of channels in the file is not supported\&. |
| 117 |
.RE |
| 118 |
.PP |
| 119 |
AF_BAD_FILESETUP |
| 120 |
.RS 4 |
| 121 |
|
| 122 |
setup |
| 123 |
specifies an invalid or unsupported configuration\&. |
| 124 |
.RE |
| 125 |
.SH "SEE ALSO" |
| 126 |
.sp |
| 127 |
\fBafCloseFile\fR(3), \fBafNewFileSetup\fR(3), \fBafInitFileFormat\fR(3), \fBafInitSampleFormat\fR(3), \fBafReadFrames\fR(3), \fBafWriteFrames\fR(3) |
| 128 |
.SH "AUTHOR" |
| 129 |
.sp |
| 130 |
Michael Pruett <michael@68k\&.org> |