1
0

AudioCoderFlac.h 750 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include "../nsv/enc_if.h"
  3. #include <FLAC/stream_encoder.h>
  4. #include "StreamFileWin32.h"
  5. typedef struct {
  6. unsigned int compression; // 0-8
  7. } configtype;
  8. class AudioCoderFlac : public AudioCoder
  9. {
  10. public:
  11. AudioCoderFlac(unsigned int nch, unsigned int bps, unsigned int samplerate, unsigned int compression);
  12. ~AudioCoderFlac();
  13. int Encode(int framepos, void *in, int in_avail, int *in_used, void *out, int out_avail); //returns bytes in out
  14. void PrepareToFinish();
  15. void Finish(const wchar_t *destination);
  16. bool OK();
  17. private:
  18. FLAC__StreamEncoder *encoder;
  19. FLAC__StreamMetadata *padding;
  20. Win32_State win32State;
  21. unsigned int nch;
  22. unsigned int bps;
  23. wchar_t tempFile[MAX_PATH];
  24. bool finished;
  25. FLAC__uint64 finishedBytes;
  26. };