View Single Post
  #7  
Old 13-02-2012, 10:13
amin fear amin fear is offline
Registered User
 
Join Date: Feb 2012
Location: Inferno
Posts: 102
Thanks: 86
Thanked 57 Times in 30 Posts
amin fear is on a distinguished road
Bass

Ok ... it seems no guy here have a solution for background music function ...

i have searched all the web for something cool and found this script ...

[CODE][Setup]
AppName=Music During Installation
AppVerName=Music During Installation
CreateAppDir=no
DisableProgramGroupPage=yes
DefaultGroupName=Music During Installation

[Files]
Source: "BASS.dll"; DestDir: "{tmp}"; Flags: dontcopy
Source: "sound.mp3"; DestDir: "{tmp}"; Flags: dontcopy

Code:
function BASS_Init(device: Integer; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean;
external 'BASS_Init@files:BASS.dll stdcall';
 
function BASS_StreamCreateFile(mem: BOOL; f: PAnsiChar; offset1: DWORD; offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): DWORD;
external 'BASS_StreamCreateFile@files:BASS.dll stdcall';
 
function BASS_Start(): Boolean;
external 'BASS_Start@files:BASS.dll stdcall';
 
function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean;
external 'BASS_ChannelPlay@files:BASS.dll stdcall';

function BASS_Stop(): Boolean;
external 'BASS_Stop@files:BASS.dll stdcall';
 
function BASS_Free(): Boolean;
external 'BASS_Free@files:BASS.dll stdcall';

const
  BASS_SAMPLE_LOOP = 4;

procedure InitializeWizard();
var
  mp3Handle: HWND;
  mp3Name: string;
begin
  ExtractTemporaryFile('sound.mp3');
  mp3Name := ExpandConstant('{tmp}\sound.mp3');
  BASS_Init(-1, 44100, 0, 0, 0);
  mp3Handle := BASS_StreamCreateFile(FALSE, PAnsiChar(mp3Name), 0, 0, 0, 0, BASS_SAMPLE_LOOP);
  BASS_Start();
  BASS_ChannelPlay(mp3Handle, False);
end;

procedure DeinitializeSetup();
begin
  BASS_Stop();
  BASS_Free();
end;
it uses bass.dll from un4seen corp but has no Play/Pause Button ...


anyway its not so important and i will be satisfied without it ...

i tested the script and it works perfectly on every platform ( WinXp Win7 X64 )

***********************************
I also found four scripts from Russian guys ( Credit goes to RU-Board )

they use both BASSMOD.dll ( Play Tracker Modules ) and bass.dll ( Play MP3 & etc ) . i attached them to my post ... feel free to take a look at them

they are more complicated and have BG Sound control button/checkbox ...

anyway after all of this explanation any guy here can implement the first script or even Russian guys scripts into Yener 90 great source ?

I tried ... but every time i got something like DUPLICATE IDENTIFIER error ...

any help would be appreciated ...

thanks guys for your great forum !

P.S : nothing introduced is Warez ... those DLLs are free for non-commercial purpose ...
Attached Files
File Type: rar bass.dll[Play_MP3_OGG]&BASSMOD.dll[Play_XM_MOD].rar (132.7 KB, 82 views)
File Type: rar Play_BG_Music_01.rar (15.2 KB, 44 views)
File Type: rar Play_BG_Music_02.rar (2.5 KB, 36 views)