1 /* 2 * network_audio_shared.h 3 * created for Marathon: Aleph One <http://source.bungie.org/> 4 5 Copyright (C) 2002 and beyond by Woody Zenfell, III 6 and the "Aleph One" developers. 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 3 of the License, or 11 (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 This license is contained in the file "COPYING", 19 which is included with this source code; it is available online at 20 http://www.gnu.org/licenses/gpl.html 21 22 * The code in this file is licensed to you under the GNU GPL. As the copyright holder, 23 * however, I reserve the right to use this code as I see fit, without being bound by the 24 * GPL's terms. This exemption is not intended to apply to modified versions of this file - 25 * if I were to use a modified version, I would be a licensee of whomever modified it, and 26 * thus must observe the GPL terms. 27 * 28 * Stuff shared internally between the network microphone and network speaker code. 29 * 30 * Created by woody Feb 1, 2003, largely from stuff in network_speaker_sdl.h. 31 */ 32 33 #ifndef NETWORK_AUDIO_SHARED_H 34 #define NETWORK_AUDIO_SHARED_H 35 36 #include "cseries.h" 37 38 // In-memory header for sound data 39 struct network_audio_header { 40 uint32 mReserved; // Should be 0 for now, later maybe use a FourCharCode for format? shrug 41 uint32 mFlags; 42 }; 43 44 // For network_audio_header::mFlags 45 enum { 46 kNetworkAudioForTeammatesOnlyFlag = 0x01 47 }; 48 49 50 // Useful information about the network audio 51 // Note: at present, the microphone routines ignore these settings and target 52 // 11025 unsigned 8-bit mono. If you want to change formats you'll need to edit those 53 // routines too (hopefully to make them more general ;) ). Also you'll want to somehow 54 // differentiate your format from this one (use a Flag, or value in Reserved, or an 55 // entirely new distribution type, or something). 56 const bool kNetworkAudioIsStereo = false; 57 const bool kNetworkAudioIs16Bit = true; 58 const bool kNetworkAudioIsSigned8Bit = false; 59 const int kNetworkAudioSampleRate = 8000; 60 const int kNetworkAudioBytesPerFrame = (kNetworkAudioIs16Bit ? 2 : 1) * (kNetworkAudioIsStereo ? 2 : 1); 61 62 #endif // NETWORK_AUDIO_SHARED_H 63