MMAUDIO.INT 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {========================================================================}
  2. {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
  3. {========================================================================}
  4. {= All Rights Reserved =}
  5. {========================================================================}
  6. {= D 01099 Dresden = Fax.: +49 (0)351-8037944 =}
  7. {= Loewenstr.7a = info@swiftsoft.de =}
  8. {========================================================================}
  9. {= Actual versions on http://www.swiftsoft.de/mmtools.html =}
  10. {========================================================================}
  11. {= This code is for reference purposes only and may not be copied or =}
  12. {= distributed in any format electronic or otherwise except one copy =}
  13. {= for backup purposes. =}
  14. {= =}
  15. {= No Delphi Component Kit or Component individually or in a collection=}
  16. {= subclassed or otherwise from the code in this unit, or associated =}
  17. {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =}
  18. {= without express permission from SwiftSoft. =}
  19. {= =}
  20. {= For more licence informations please refer to the associated =}
  21. {= HelpFile. =}
  22. {========================================================================}
  23. {= $Date: 13.04.98 - 15:32:17 $ =}
  24. {========================================================================}
  25. unit MMAudio;
  26. {$I COMPILER.INC}
  27. interface
  28. uses
  29. {$IFDEF WIN32}
  30. Windows,
  31. {$ELSE}
  32. WinTypes,
  33. WinProcs,
  34. {$ENDIF}
  35. SysUtils,
  36. Classes,
  37. Controls,
  38. MMSystem,
  39. MMObj,
  40. MMString,
  41. MMDSPobj,
  42. MMRegs,
  43. MMUtils,
  44. MMWave,
  45. MMWaveIO,
  46. MMMpeg,
  47. MMMPType,
  48. MMFade,
  49. MMACMCvt;
  50. type
  51. EMMAudioError = class(Exception);
  52. TMMAudioFileType = (ftWave,ftMpeg);
  53. {-- TMMAudioFile ----------------------------------------------------------}
  54. TMMAudioFile = class(TMMDSPComponent)
  55. public
  56. constructor Create(aOwner: TComponent); override;
  57. destructor Destroy; override;
  58. procedure LoadFromFile(const aFileName: String);
  59. procedure FreeFile;
  60. procedure FadeOut(Duration: Longint);
  61. property Empty: Boolean read GetEmpty;
  62. property SampleRate: Longint read GetSampleRate;
  63. property BitRate: integer read GetBitRate;
  64. property ChannelMode: TMMMode read GetChannelMode;
  65. property Position: Longint read GetPosition write SetPosition;
  66. property FileLength: Longint read GetFileLength;
  67. property PlayLength: Longint read GetPlayLength write SetPlayLength;
  68. property FadeInDuration: Longint read FFadeInDuration write SetFadeInDuration;
  69. property FadeOutDuration: Longint read FFadeOutDuration write SetFadeOutDuration;
  70. property FadeOutPosition: LongInt read FFadeOutPosition write SetFadeOutPosition;
  71. published
  72. property Output;
  73. property Enabled: Boolean read FEnabled write FEnabled default True;
  74. property MpegTrailingHeader: Longint read GetTrailingHeader write SetTrailingHeader;
  75. property FileName: TFileName read GetFileName write SetFileName;
  76. property FileType: TMMAudioFileType read GetFileType write SetFileType stored False;
  77. property Volume: Longint read FVolume write SetVolume default VOLUMEBASE;
  78. property Panning: Longint read FPanning write SetPanning default 0;
  79. end;
  80. function IsValidAudioFile(FileName: TFileName): Boolean;
  81. procedure Register;