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.

74 lines
1.8 KiB

  1. /******************************************************************************
  2. * SynthUnit.h *
  3. *-------------*
  4. *
  5. *------------------------------------------------------------------------------
  6. * Copyright (C) 1996 Entropic, Inc
  7. * Copyright (C) 2000 Microsoft Corporation Date: 03/02/00
  8. * All Rights Reserved
  9. *
  10. ********************************************************************* PACOG ***/
  11. #ifndef __SYNTHUNIT_H_
  12. #define __SYNTHUNIT_H_
  13. #include <vector>
  14. struct Epoch;
  15. struct NewF0Struct;
  16. class CSynth
  17. {
  18. friend class CTips;
  19. friend class CSpeakerData;
  20. public:
  21. CSynth(int iSampFreq);
  22. ~CSynth();
  23. int LpcAnalysis (int iSampFreq, int iOrder);
  24. int FindPrecedent ();
  25. int NextBuffer (CTips* pTips);
  26. void GetNewF0 (std::vector<NewF0Struct>* pvNewF0, double* pdTime, double* pdRunTime );
  27. protected:
  28. double* GetDurbinCoef(double* data, int nData);
  29. void FreeLpcCoef();
  30. short ClipData (double x);
  31. int m_iSampFreq;
  32. // Read from the input files
  33. double m_dRunTimeLimit;
  34. double m_dGain; // Gain to aply to the whole segment
  35. // Read from the database
  36. char m_pszChunkName[256];
  37. int m_iNumSamples;
  38. double* m_pdSamples;
  39. int m_iNumEpochs;
  40. Epoch* m_pEpochs;
  41. // Computed for synthesis
  42. double* m_pdSynEpochs; // Synthesis epoch track
  43. int* m_piMapping;
  44. int m_iNumSynEpochs;
  45. // For lpc synthesis
  46. double** m_ppdLpcCoef;
  47. int m_iLpcOrder;
  48. //While synthesizing, tracks current epoch
  49. int m_iCurrentPeriod;
  50. int m_iRepetitions;
  51. int m_iInvert;
  52. // For Wave Concatenation Synth
  53. double m_dF0Ratio;
  54. };
  55. #endif