📄 pwavfile_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>pwavfile.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>pwavfile.h</h1><a href="pwavfile_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * pwavfile.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * WAV file I/O channel class.</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Copyright (c) 2001 Equivalence Pty. Ltd.</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * The contents of this file are subject to the Mozilla Public License</span>00011 <span class="comment"> * Version 1.0 (the "License"); you may not use this file except in</span>00012 <span class="comment"> * compliance with the License. You may obtain a copy of the License at</span>00013 <span class="comment"> * http://www.mozilla.org/MPL/</span>00014 <span class="comment"> *</span>00015 <span class="comment"> * Software distributed under the License is distributed on an "AS IS"</span>00016 <span class="comment"> * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See</span>00017 <span class="comment"> * the License for the specific language governing rights and limitations</span>00018 <span class="comment"> * under the License.</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * The Original Code is Portable Windows Library.</span>00021 <span class="comment"> *</span>00022 <span class="comment"> * The Initial Developer of the Original Code is</span>00023 <span class="comment"> * Roger Hardiman <roger@freebsd.org></span>00024 <span class="comment"> * and Shawn Pai-Hsiang Hsiao <shawn@eecs.harvard.edu></span>00025 <span class="comment"> *</span>00026 <span class="comment"> * All Rights Reserved.</span>00027 <span class="comment"> *</span>00028 <span class="comment"> * Contributor(s): ______________________________________.</span>00029 <span class="comment"> *</span>00030 <span class="comment"> * $Log: pwavfile.h,v $</span>00031 <span class="comment"> * Revision 1.14 2004/07/15 03:12:41 csoutheren</span>00032 <span class="comment"> * Migrated changes from crs_vxnml_devel branch into main trunk</span>00033 <span class="comment"> *</span>00034 <span class="comment"> * Revision 1.13.4.4 2004/07/13 08:13:04 csoutheren</span>00035 <span class="comment"> * Lots of implementation of factory-based PWAVFile</span>00036 <span class="comment"> *</span>00037 <span class="comment"> * Revision 1.13.4.3 2004/07/12 09:17:19 csoutheren</span>00038 <span class="comment"> * Fixed warnings and errors under Linux</span>00039 <span class="comment"> *</span>00040 <span class="comment"> * Revision 1.13.4.2 2004/07/12 08:30:16 csoutheren</span>00041 <span class="comment"> * More fixes for abstract factory implementation of PWAVFile</span>00042 <span class="comment"> *</span>00043 <span class="comment"> * Revision 1.13.4.1 2004/07/07 07:07:41 csoutheren</span>00044 <span class="comment"> * Changed PWAVFile to use abstract factories (extensively)</span>00045 <span class="comment"> * Removed redundant blocking/unblocking when using G.723.1</span>00046 <span class="comment"> * More support for call transfer</span>00047 <span class="comment"> *</span>00048 <span class="comment"> * Revision 1.13 2003/03/07 06:12:05 robertj</span>00049 <span class="comment"> * Added more WAV file "magic numbers".</span>00050 <span class="comment"> *</span>00051 <span class="comment"> * Revision 1.12 2002/09/16 01:08:59 robertj</span>00052 <span class="comment"> * Added #define so can select if #pragma interface/implementation is used on</span>00053 <span class="comment"> * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.</span>00054 <span class="comment"> *</span>00055 <span class="comment"> * Revision 1.11 2002/06/20 00:51:38 craigs</span>00056 <span class="comment"> * Added virtuals to allow overriding</span>00057 <span class="comment"> *</span>00058 <span class="comment"> * Revision 1.10 2002/05/21 01:56:53 robertj</span>00059 <span class="comment"> * Removed the enum which made yet another set of magic numbers for audio</span>00060 <span class="comment"> * formats, now uses the WAV file format numbers.</span>00061 <span class="comment"> * Fixed failure to write header when destroying object without and explicit</span>00062 <span class="comment"> * call to Close().</span>00063 <span class="comment"> * Fixed missing Open() function which does not have file name parameter.</span>00064 <span class="comment"> * Added ability to set the audio format after construction.</span>00065 <span class="comment"> *</span>00066 <span class="comment"> * Revision 1.9 2002/01/22 03:55:07 craigs</span>00067 <span class="comment"> * Added #define guards when file moved to PTCLib</span>00068 <span class="comment"> *</span>00069 <span class="comment"> * Revision 1.8 2002/01/13 21:00:41 rogerh</span>00070 <span class="comment"> * The type of new .WAV files must now be specified in the class constructor.</span>00071 <span class="comment"> * Take out Open() function from the last commit and create a new Open()</span>00072 <span class="comment"> * function which replaces the one in the PFile base class.</span>00073 <span class="comment"> *</span>00074 <span class="comment"> * Revision 1.7 2002/01/11 16:33:46 rogerh</span>00075 <span class="comment"> * Create a PWAVFile Open() function, which processes the WAV header</span>00076 <span class="comment"> *</span>00077 <span class="comment"> * Revision 1.6 2001/10/16 13:27:37 rogerh</span>00078 <span class="comment"> * Add support for writing G.723.1 WAV files.</span>00079 <span class="comment"> * MS Windows can play G.723.1 WAV Files in Media Player and Sound Recorder.</span>00080 <span class="comment"> * Sound Recorder can also convert them to normal PCM format WAV files.</span>00081 <span class="comment"> * Thanks go to M.Stoychev <M.Stoychev@cnsys.bg> for sample WAV files.</span>00082 <span class="comment"> *</span>00083 <span class="comment"> * Revision 1.5 2001/10/15 11:48:15 rogerh</span>00084 <span class="comment"> * Add GetFormat to return the format of a WAV file</span>00085 <span class="comment"> *</span>00086 <span class="comment"> * Revision 1.4 2001/07/23 01:20:20 rogerh</span>00087 <span class="comment"> * Add updates from Shawn - ensure isvalidWAV is false for zero length files.</span>00088 <span class="comment"> * GetDataLength uses actual file size to support file updates as well as appends.</span>00089 <span class="comment"> * Add updates from Roger - Update Header() just writes to specific fields which</span>00090 <span class="comment"> * preserves any 'extra' data in an existing header between FORMAT and DATA chunks.</span>00091 <span class="comment"> *</span>00092 <span class="comment"> * Revision 1.3 2001/07/20 07:06:27 rogerh</span>00093 <span class="comment"> * Fix a typo</span>00094 <span class="comment"> *</span>00095 <span class="comment"> * Revision 1.2 2001/07/20 03:30:59 robertj</span>00096 <span class="comment"> * Minor cosmetic changes to new PWAVFile class.</span>00097 <span class="comment"> *</span>00098 <span class="comment"> * Revision 1.1 2001/07/19 09:55:48 rogerh</span>00099 <span class="comment"> * Add PWAVFile, a class to read and write .wav files, written by</span>00100 <span class="comment"> * Roger Hardiman and <roger@freebsd.org> and</span>00101 <span class="comment"> * Shawn Pai-Hsiang Hsiao <shawn@eecs.harvard.edu></span>00102 <span class="comment"> *</span>00103 <span class="comment"> *</span>00104 <span class="comment"> */</span>00105 00106 <span class="preprocessor">#ifndef _PWAVFILE</span>00107 <span class="preprocessor"></span><span class="preprocessor">#define _PWAVFILE</span>00108 <span class="preprocessor"></span>00109 <span class="comment">//#ifdef P_USE_PRAGMA</span>00110 <span class="comment">//#pragma interface</span>00111 <span class="comment">//#endif</span>00112 00113 <span class="keyword">class </span><a class="code" href="classPWAVFile.html">PWAVFile</a>;00114 <a name="l00115"></a><a class="code" href="namespacePWAV.html">00115</a> <span class="keyword">namespace </span>PWAV {00116 00117 <span class="preprocessor">#ifdef __GNUC__</span>00118 <span class="preprocessor"></span><span class="preprocessor">#define P_PACKED __attribute__ ((packed));</span>00119 <span class="preprocessor"></span><span class="preprocessor">#else</span><a name="l00120"></a><a class="code" href="pwavfile_8h.html#a0">00120</a> <span class="preprocessor"></span><span class="preprocessor">#define P_PACKED</span>00121 <span class="preprocessor"></span><span class="preprocessor">#pragma pack(1)</span>00122 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00123 <span class="preprocessor"></span><a name="l00124"></a><a class="code" href="structPWAV_1_1ChunkHeader.html">00124</a> <span class="keyword">struct </span><a class="code" href="structPWAV_1_1ChunkHeader.html">ChunkHeader</a>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -