Niotso  git revision 558726a9f13d7c3423a683dd2f4323589b66c310
The New Implementation of The Sims Online
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
read_xa.h
Go to the documentation of this file.
1 /*
2  FileHandler - General-purpose file handling library for Niotso
3  read_xa.h - Copyright (c) 2012 Niotso Project <http://niotso.org/>
4  Author(s): Fatbag <X-Fi6@phppoll.org>
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 
19 typedef struct
20 {
21  char szID[4];
22  uint32_t dwOutSize;
23  /* WAVEFORMATEX */
24  uint16_t wFormatTag;
25  uint16_t nChannels;
26  uint32_t nSamplesPerSec;
27  uint32_t nAvgBytesPerSec;
28  uint16_t nBlockAlign;
29  uint16_t wBitsPerSample;
30 
31  size_t Frames;
32  size_t XADataSize;
33 } xaheader_t;
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 size_t xa_compressed_size(size_t Frames, size_t Channels);
40 int xa_read_header(xaheader_t * XAHeader, const uint8_t * Buffer, size_t FileSize);
41 int xa_decode(const uint8_t *__restrict InBuffer, uint8_t *__restrict OutBuffer, size_t Frames, size_t Channels);
42 
43 #ifdef __cplusplus
44 }
45 #endif