You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
851B

  1. #ifndef _riff_acm_h_
  2. #define _riff_acm_h_
  3. #include <stdint.h>
  4. #include <stddef.h>
  5. #ifndef WAVE_FORMAT_PCM
  6. #define WAVE_FORMAT_PCM 1
  7. #define WAVE_FORMAT_ADPCM 2
  8. #define WAVE_FORMAT_ALAW 6
  9. #define WAVE_FORMAT_MULAW 7
  10. #endif
  11. #if defined(__cplusplus)
  12. extern "C" {
  13. #endif
  14. #pragma pack(push)
  15. #pragma pack(1)
  16. struct wave_format_t
  17. {
  18. uint16_t wFormatTag;
  19. uint16_t nChannels;
  20. uint32_t nSamplesPerSec;
  21. uint32_t nAvgBytesPerSec;
  22. uint16_t nBlockAlign;
  23. uint16_t wBitsPerSample;
  24. uint16_t cbSize;
  25. // WAVEFORMATEXTENSIBLE(only cbSize > 0)
  26. uint16_t Samples;
  27. uint32_t dwChannelMask;
  28. uint8_t SubFormat[16];
  29. };
  30. #pragma pack(pop)
  31. int wave_format_load(const uint8_t* data, int bytes, struct wave_format_t* wav);
  32. int wave_format_save(const struct wave_format_t* wav, uint8_t* data, int bytes);
  33. #if defined(__cplusplus)
  34. }
  35. #endif
  36. #endif /* !_riff_acm_h_ */