123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #pragma once
- #include "foundation/types.h"
- #include "MPEGHeader.h"
- #define FRAMES_FLAG 0x0001
- #define BYTES_FLAG 0x0002
- #define TOC_FLAG 0x0004
- #define VBR_SCALE_FLAG 0x0008
- #define FRAMES_AND_BYTES (FRAMES_FLAG | BYTES_FLAG)
- struct LAMEInfo
- {
- LAMEInfo();
- uint64_t GetSeekPoint(double percent) const;
- int Read(const MPEGHeader &frame, const uint8_t *buffer, size_t bufferlen);
- double GetLengthSeconds() const;
- uint64_t GetSamples() const;
- uint32_t GetFrames() const;
- bool Flag(int flag) const;
- int GetGaps(size_t *pregap, size_t *postgap);
- protected:
- int version;
- int sample_rate;
- int samples_per_frame;
- int cbr;
-
- int flags;
- uint32_t frames;
- uint64_t bytes;
- int vbr_scale;
- uint8_t toc[100];
-
-
- char encoder[32];
- float peak;
- float replaygain_album_gain;
- float replaygain_track_gain;
- unsigned short lowpass;
- unsigned short encoder_delay;
- unsigned short padding;
- uint8_t encoding_method;
- uint8_t tag_revision;
- uint8_t abr_bitrate;
- uint32_t music_length;
- uint16_t music_crc;
- uint16_t tag_crc;
- };
- enum
- {
- ENCODING_METHOD_LAME = 0,
- ENCODING_METHOD_CBR = 1,
- ENCODING_METHOD_ABR = 2,
- ENCODING_METHOD_VBR1 = 3,
- ENCODING_METHOD_VBR2 = 4,
- ENCODING_METHOD_VBR3 = 5,
- ENCODING_METHOD_VBR4 = 6,
- ENCODING_METHOD_CBR_2PASS = 8,
- ENCODING_METHOD_ABR_2PASS = 9,
- };
- int ReadLAMEInfo(const MPEGHeader &frame, const uint8_t *buffer, LAMEInfo *lameInfo);
|