4 * WAV file class with auto-PCM conversion
8 * Copyright (c) 2002 Equivalence Pty. Ltd.
10 * The contents of this file are subject to the Mozilla Public License
11 * Version 1.0 (the "License"); you may not use this file except in
12 * compliance with the License. You may obtain a copy of the License at
13 * http://www.mozilla.org/MPL/
15 * Software distributed under the License is distributed on an "AS IS"
16 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17 * the License for the specific language governing rights and limitations
20 * The Original Code is Open H323 Library.
22 * Contributor(s): ______________________________________.
24 * $Log: opalwavfile.h,v $
25 * Revision 1.9 2005/11/30 13:05:01 csoutheren
26 * Changed tags for Doxygen
28 * Revision 1.8 2004/08/26 08:05:03 csoutheren
29 * Codecs now appear in abstract factory system
30 * Fixed Windows factory bootstrap system (again)
32 * Revision 1.7 2004/08/09 11:11:33 csoutheren
33 * Added stupid windows hack to force opalwavfile factories to register
35 * Revision 1.6 2004/07/15 11:13:49 rjongbloed
36 * Migrated changes from crs_vxnml_devel branch into main trunk
38 * Revision 1.5.6.1 2004/07/07 07:10:11 csoutheren
39 * Changed to use new factory based PWAVFile
40 * Removed redundant blocking/unblocking when using G.723.1
42 * Revision 1.5 2002/09/16 01:14:15 robertj
43 * Added #define so can select if #pragma interface/implementation is used on
44 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
46 * Revision 1.4 2002/09/06 06:20:37 robertj
47 * More cosmetic changes
49 * Revision 1.3 2002/08/08 13:00:02 craigs
50 * Remove unused definition of LastReadCount thanks to Peter 'Luna' Runestig
52 * Revision 1.2 2002/08/05 10:03:47 robertj
53 * Cosmetic changes to normalise the usage of pragma interface/implementation.
55 * Revision 1.1 2002/06/20 01:21:03 craigs
60 #ifndef __OPALWAVFILE_H
61 #define __OPALWAVFILE_H
68 #include <ptclib/pwavfile.h>
70 /**This class is similar to the PWavFile class found in the PWlib
71 components library. However, it will tranparently convert all data
72 to/from PCM format, allowing applications to be unconcerned with
73 the underlying data format. Note that this will only work with
74 sample-based formats that can be converted to/from PCM data, such as
78 class OpalWAVFile : public PWAVFile
80 PCLASSINFO(OpalWAVFile, PWAVFile);
83 unsigned format = fmt_PCM ///< Type of WAV File to create
86 /**Create a unique temporary file name, and open the file in the specified
87 mode and using the specified options. Note that opening a new, unique,
88 temporary file name in ReadOnly mode will always fail. This would only
89 be usefull in a mode and options that will create the file.
91 If a WAV file is being created, the type parameter can be used
92 to create a PCM Wave file or a G.723.1 Wave file by using
95 The #PChannel::IsOpen()# function may be used after object
96 construction to determine if the file was successfully opened.
99 OpenMode mode, ///< Mode in which to open the file.
100 int opts = ModeDefault, ///< #OpenOptions enum# for open operation.
101 unsigned format = fmt_PCM ///< Type of WAV File to create
104 /**Create a WAV file object with the specified name and open it in
105 the specified mode and with the specified options.
106 If a WAV file is being created, the type parameter can be used
107 to create a PCM Wave file or a G.723.1 Wave file by using
110 The #PChannel::IsOpen()# function may be used after object
111 construction to determine if the file was successfully opened.
114 const PFilePath & name, ///< Name of file to open.
115 OpenMode mode = ReadWrite, ///< Mode in which to open the file.
116 int opts = ModeDefault, ///< #OpenOptions enum# for open operation.
117 unsigned format = fmt_PCM ///< Type of WAV File to create
121 #endif // __OPALWAVFILE_H
124 // End of File ///////////////////////////////////////////////////////////////