Source code of Windows XP (NT5)
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.

49 lines
1.4 KiB

  1. //==========================================================================
  2. //
  3. // tsm.h --
  4. //
  5. // Class definition for the time-scale modification algorithm
  6. //
  7. //==========================================================================
  8. #ifndef _TSM_H_
  9. #define _TSM_H_
  10. #include <windows.h>
  11. #include <mmreg.h>
  12. class CTsm
  13. {
  14. public:
  15. CTsm (double timeScale, int iSampFreq = 8000, int* piFrameLen = 0, int* piFrameShift = 0);
  16. ~CTsm();
  17. int SetScaleFactor (double timeScale);
  18. int SetSamplingFrequency (int iSampFreq);
  19. double GetScaleFactor () { return m_dScale; }
  20. int FirstFrame (double* pdBuffer);
  21. int AddFrame (double* pdBuffer, int* piLag, int* piNumSamp);
  22. int LastFrame (double* pdBuffer, int iBufLen, int* piLag, int* piNumSamp);
  23. int GetFrameLen() { return m_iFrameLen; }
  24. int GetFrameShift() { return m_iFrameShift; }
  25. int AdjustTimeScale(const void* pvInSamples, const int iNumInSamples,
  26. void** ppvOutSamples, int* piNumOutSamples, WAVEFORMATEX* pFormat);
  27. private:
  28. int Crosscor (double* pdFirst, double* pdSecond, int iNumXCor, int iNumPts);
  29. int m_iWinLen;
  30. int m_iShiftAna;
  31. int m_iShiftSyn;
  32. int m_iShiftMax;
  33. int m_iFrameLen;
  34. int m_iFrameShift;
  35. int m_iNumPts;
  36. int m_iLag;
  37. double m_dScale;
  38. double* m_pfOldTail;
  39. };
  40. #endif