Audacity  2.2.2
MultiFormatReader.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  MultiFormatReader.h
6 
7  Philipp Sibler
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_MULTIFORMATREADER_H__
12 #define __AUDACITY_MULTIFORMATREADER_H__
13 
14 #include <stdio.h>
15 #include <stdint.h>
16 
18 {
19 public:
20  typedef enum
21  {
22  Little = 0,
24  } EndiannessT;
25 
28  {}
29 
30  int IsLittle()
31  {
32  return (mFlag == MachineEndianness::Little) ? 1 : 0;
33  }
34 
35  int IsBig()
36  {
37  return (mFlag == MachineEndianness::Big) ? 1 : 0;
38  }
39 
41  {
42  return mFlag;
43  }
44 
45 private:
47 };
48 
50 {
51  FILE* mpFid;
53  uint8_t mSwapBuffer[8];
54 
55 public:
56  typedef enum
57  {
58  Int8 = 0,
66  } FormatT;
67 
68  MultiFormatReader(const char* filename);
70 
71  void Reset();
72  size_t ReadSamples(void* buffer, size_t len,
75  size_t ReadSamples(void* buffer, size_t len, size_t stride,
78 
79 private:
80  size_t Read(void* buffer, size_t size, size_t len, size_t stride);
81  void SwapBytes(void* buffer, size_t size, size_t len);
82 };
83 
84 #endif
MultiFormatReader(const char *filename)
MachineEndianness mEnd
MultiFormatReader reads raw audio files in different formats and machine endianness representations...
size_t ReadSamples(void *buffer, size_t len, MultiFormatReader::FormatT format, MachineEndianness::EndiannessT end)
size_t Read(void *buffer, size_t size, size_t len, size_t stride)
int format
Definition: ExportPCM.cpp:56
EndiannessT Which()
void SwapBytes(void *buffer, size_t size, size_t len)