2
abstract definition of an audio frame
3
Copyright (C) 2001 Martin Vogt
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU Library General Public License as published by
7
the Free Software Foundation.
9
For more information look at the file COPYRIGHT in this package
16
#ifndef __AUDIOFRAME_H
17
#define __AUDIOFRAME_H
24
#ifndef WORDS_BIGENDIAN
25
#define AUDIOFRAME_BIGENDIAN 1
27
#define AUDIOFRAME_BIGENDIAN 0
32
#define SCALFACTOR SHRT_MAX
33
#define MP3FRAMESIZE (2*2*2*32*18)
36
class AudioFrame : public Frame {
43
virtual ~AudioFrame();
45
// info about "import" data
46
void setFrameFormat(int stereo,int freq);
48
inline int getStereo() { return stereo; }
49
inline int getFrequenceHZ() { return frequencyHZ; }
51
// these return values depend on the implementation
52
// how the data is stored internally after "import"
53
inline int getSampleSize() { return sampleSize; }
54
inline int getBigEndian() { return lBigEndian; }
55
inline int getSigned() { return lSigned; }
59
virtual void setLen(int len);
60
virtual int getSize();
61
virtual void clearrawdata();
64
virtual void putFloatData(float* data,int len);
65
virtual void putFloatData(float* left,float* right,int len);
68
int isFormatEqual(AudioFrame* compare);
69
// Note: this can only be called with _real_ AudioFrame's as dest
70
void copyFormat(AudioFrame* dest);
72
void print(const char* msg);