Advertisement
TLama

Untitled

Aug 20th, 2014
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.88 KB | None | 0 0
  1. [Setup]
  2. AppName=My Program & Bass Audio Project :-)
  3. AppVersion=1.5
  4. DefaultDirName={pf}\My Program
  5. WizardImageFile=WelcomeImage.bmp
  6.  
  7. [Files]
  8. Source: "Bass.dll"; Flags: dontcopy
  9. Source: "AudioFile.mp3"; Flags: dontcopy
  10. Source: "FinalImage.bmp"; Flags: dontcopy
  11.  
  12. [Code]
  13. const  
  14.   BASS_SAMPLE_LOOP = 4;
  15.   BASS_UNICODE = $80000000;
  16.   BASS_CONFIG_GVOL_STREAM = 5;
  17.   #ifndef UNICODE
  18.     EncodingFlag = 0;
  19.   #else
  20.     EncodingFlag = BASS_UNICODE;
  21.   #endif
  22.  
  23. type
  24.   HSTREAM = DWORD;
  25.  
  26. function BASS_Init(device: LongInt; freq, flags: DWORD;
  27.   win: HWND; clsid: Cardinal): BOOL;
  28.   external 'BASS_Init@files:bass.dll stdcall';
  29. function BASS_StreamCreateFile(mem: BOOL; f: string; offset1: DWORD;
  30.   offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): HSTREAM;
  31.   external 'BASS_StreamCreateFile@files:bass.dll stdcall';
  32. function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL;
  33.   external 'BASS_ChannelPlay@files:bass.dll stdcall';
  34. function BASS_SetConfig(option: DWORD; value: DWORD ): BOOL;
  35.   external 'BASS_SetConfig@files:bass.dll stdcall';
  36. function BASS_Free: BOOL;
  37.   external 'BASS_Free@files:bass.dll stdcall';
  38.  
  39. procedure InitializeWizard;
  40. var
  41.   StreamHandle: HSTREAM;
  42. begin
  43.   // extract the file from the [Files] section to the temporary folder
  44.   ExtractTemporaryFile('FinalImage.bmp');
  45.   // and load the just extracted bitmap to the image on the final page
  46.   WizardForm.WizardBitmapImage2.Bitmap.LoadFromFile(ExpandConstant('{tmp}\FinalImage.bmp'));
  47.  
  48.   ExtractTemporaryFile('AudioFile.mp3');
  49.   if BASS_Init(-1, 44100, 0, 0, 0) then
  50.   begin
  51.     StreamHandle := BASS_StreamCreateFile(False,
  52.       ExpandConstant('{tmp}\AudioFile.mp3'), 0, 0, 0, 0,
  53.       EncodingFlag or BASS_SAMPLE_LOOP);
  54.     BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 2500);
  55.     BASS_ChannelPlay(StreamHandle, False);
  56.   end;
  57. end;
  58.  
  59. procedure DeinitializeSetup;
  60. begin
  61.   BASS_Free;
  62. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement