1
0

FLVAudioHeader.h 769 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef NULLSOFT_FLVAUDIOHEADER_H
  2. #define NULLSOFT_FLVAUDIOHEADER_H
  3. namespace FLV
  4. {
  5. const int AUDIO_FORMAT_PCM = 0;
  6. const int AUDIO_FORMAT_ADPCM = 1;
  7. const int AUDIO_FORMAT_MP3 = 2;
  8. const int AUDIO_FORMAT_PCM_LE = 3; // little endian
  9. const int AUDIO_FORMAT_NELLYMOSER_16KHZ = 4;
  10. const int AUDIO_FORMAT_NELLYMOSER_8KHZ = 5;
  11. const int AUDIO_FORMAT_NELLYMOSER = 6;
  12. const int AUDIO_FORMAT_A_LAW = 7;
  13. const int AUDIO_FORMAT_MU_LAW = 8;
  14. const int AUDIO_FORMAT_AAC = 10;
  15. const int AUDIO_FORMAT_MP3_8KHZ = 14;
  16. };
  17. class FLVAudioHeader
  18. {
  19. public:
  20. bool Read(unsigned __int8 *data, size_t size); // size must be >=1, returns "true" if this was a valid header
  21. // attributes, consider these read-only
  22. bool stereo;
  23. int bits;
  24. int sampleRate;
  25. int format;
  26. };
  27. #endif