Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.88 KB | None | 0 0
  1. #ifndef __WAVREADER_H__
  2. #define __WAVREADER_H__
  3.  
  4. #include <stdint.h>
  5. #include <stdio.h>
  6.  
  7. struct WavHeader {
  8.     char cRiff[4];
  9.     uint32_t uiFileSize;
  10.     char cWaveMark[4];
  11.     char cFmtMarker[4];
  12.     uint32_t iFmtLen;
  13.     uint16_t iFmtType;
  14.     uint16_t iChannels;
  15.     uint32_t iSampleRate;
  16.     uint32_t iByteRate;
  17.     uint16_t iAlignment;
  18.     uint16_t iBitsPerSample;
  19.     char cData[4];
  20.     uint32_t iDataSize;
  21. };
  22.  
  23. struct WavHeader * readWaveHeader (FILE * fh);
  24. struct WavHeader * createWaveHeader (uint16_t channels, uint32_t samplerate, uint16_t bits);
  25. void printWaveHeader (struct WavHeader * header);
  26. int WaveReadFrame(FILE *fh, struct WavHeader * header,int iFrameSize, double *output);
  27. int WaveWriteFrame(FILE *fh, struct WavHeader * header, int iFrameSize, double *frame);
  28. void WaveWriteHeader(FILE *fh, struct WavHeader * header);
  29.  
  30. #endif /* __WAVREADER_H__ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement