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 129 130
|
'\" t
.\" Title: afOpenFile
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" Date: 03/06/2013
.\" Manual: \ \&
.\" Source: Audio File Library 0.3.6
.\" Language: English
.\"
.TH "AFOPENFILE" "3" "03/06/2013" "Audio File Library 0\&.3\&.6" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
afOpenFile \- open an audio file and create a file handle structure used for subsequent calls to the Audio File Library
.SH "SYNOPSIS"
.sp
.nf
#include <audiofile\&.h>
.fi
.sp
.nf
AFfilehandle afOpenFile(const char *path, const char *mode,
AFfilesetup setup);
.fi
.SH "PARAMETERS"
.sp
\fIpath\fR is the path to the file to be opened\&.
.sp
\fImode\fR specifies a mode for opening the file: "r" for reading or "w" for writing\&.
.sp
\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\&.
.SH "RETURN VALUE"
.sp
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\&.
.sp
\fBafCloseFile\fR(3) is used to close the file when it is no longer needed\&.
.SH "ERRORS"
.sp
afOpenFile can produce the following errors:
.PP
AF_BAD_OPEN
.RS 4
A call to
open
failed\&.
.RE
.PP
AF_BAD_READ
.RS 4
A call to
read
failed
.RE
.PP
AF_BAD_WRITE
.RS 4
A call to
write
failed\&.
.RE
.PP
AF_BAD_LSEEK
.RS 4
A call to
lseek
failed\&.
.RE
.PP
AF_BAD_MALLOC
.RS 4
Memory allocation failed\&.
.RE
.PP
AF_BAD_FILEFMT
.RS 4
setup
specifies a file format which is unsupported for
mode\&.
.RE
.PP
AF_BAD_SAMPFMT
.RS 4
The file\(cqs sample format is not supported\&.
.RE
.PP
AF_BAD_WIDTH
.RS 4
The file\(cqs sample width is not supported\&.
.RE
.PP
AF_BAD_RATE
.RS 4
The file\(cqs sample rate is not supported\&.
.RE
.PP
AF_BAD_CHANNELS
.RS 4
The number of channels in the file is not supported\&.
.RE
.PP
AF_BAD_FILESETUP
.RS 4
setup
specifies an invalid or unsupported configuration\&.
.RE
.SH "SEE ALSO"
.sp
\fBafCloseFile\fR(3), \fBafNewFileSetup\fR(3), \fBafInitFileFormat\fR(3), \fBafInitSampleFormat\fR(3), \fBafReadFrames\fR(3), \fBafWriteFrames\fR(3)
.SH "AUTHOR"
.sp
Michael Pruett <michael@68k\&.org>
|