Leaked source code of windows server 2003
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.

81 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1995-1996 Microsoft Corporation
  3. Module Name:
  4. audpackt.h
  5. Abstract:
  6. Contains prototypes for the AudioPacket class, which encapsulates a sound buffer in
  7. its various states: recorded/encoded/network/decoded/playing etc.
  8. --*/
  9. #ifndef _AUDPACKT_H_
  10. #define _AUDPACKT_H_
  11. #include <pshpack8.h> /* Assume 8 byte packing throughout */
  12. #define AP_NUM_PREAMBLE_PACKETS 6
  13. //
  14. // Start of Interpolation defines
  15. //
  16. // Recovering techniques
  17. typedef enum tagTECHNIQUE
  18. {
  19. techPATT_MATCH_PREV_SIGN_CC, // Replicate from the previous frame using pattern matching and signed cross-correlation
  20. techPATT_MATCH_NEXT_SIGN_CC, // Replicate from the previous frame using pattern matching and signed cross-correlation
  21. techPATT_MATCH_BOTH_SIGN_CC, // Interpolate between the previous and the next frame using pattern matching and signed cross-correlation
  22. techDUPLICATE_PREV, // Replicate last frame
  23. techDUPLICATE_NEXT // Replicate next frame
  24. }TECHNIQUE;
  25. // Wave Substitution structure
  26. typedef struct tagPCMSUB
  27. {
  28. short *pwWaSuBf; // Pointer to missing buffer
  29. short *pwPrBf; // Pointer to previous audio buffer
  30. short *pwNeBf; // Pointer to next audio buffer
  31. DWORD dwBfSize; // Number of samples in audio buffer
  32. DWORD dwSaPeSe; // Frequency sampling for ALL buffers (in samples per second)
  33. DWORD dwBiPeSa; // Number of bits per sample for ALL buffers (in bits per sample)
  34. TECHNIQUE eTech; // Technique to be used
  35. BOOL fScal; // Scale reconstructed frame
  36. }PCMSUB;
  37. #define PATTERN_SIZE 4 // Pattern size in milliseconds. Experiment with values between 2 and 8 ms.
  38. #define SEARCH_SIZE 8 // Window search size in milliseconds. Experiment with values between 8 and 16 ms.
  39. //
  40. // End of Interpolation defines
  41. //
  42. class AudioPacket : public MediaPacket
  43. {
  44. public:
  45. virtual HRESULT Initialize ( MEDIAPACKETINIT * p );
  46. virtual HRESULT Play ( MMIODEST *pmmioDest, UINT uDataType );
  47. virtual HRESULT Record ( void );
  48. virtual HRESULT Interpolate ( MediaPacket * pPrev, MediaPacket * pNext);
  49. virtual HRESULT GetSignalStrength ( PDWORD pdwMaxStrength );
  50. HRESULT ComputePower ( PDWORD pdwVoiceStrength, PWORD pwPeakStrength);
  51. virtual HRESULT MakeSilence ( void );
  52. virtual HRESULT Open ( UINT uType, DPHANDLE hdl ); // called by RxStream or TxStream
  53. virtual HRESULT Close ( UINT uType ); // called by RxStream or TxStream
  54. virtual BOOL IsBufferDone ( void );
  55. virtual BOOL IsSameMediaFormat(PVOID fmt1,PVOID fmt2);
  56. virtual DWORD GetDevDataSamples();
  57. void WriteToFile (MMIODEST *pmmioDest);
  58. void ReadFromFile (MMIOSRC *pmmioSrc);
  59. HRESULT PCMSubstitute( PCMSUB *pPCMSub);
  60. };
  61. #include <poppack.h> /* End byte packing */
  62. #endif