View Single Post
  #6  
Old 22-01-2018, 19:15
occan's Avatar
occan occan is offline
Registered User
 
Join Date: Jan 2018
Location: Argentina
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
occan is on a distinguished road
hola aqui encontre algo por internet, que me funciona teniendo los archivos bass.dll,bp.dll,el audio y el archivo .iss pero al copiarlo al programa no funciona

[Files]
Source: "C:\Program Files (x86)\Inno Setup 5\Dll Pack\BASS.dll"; Flags: dontcopy
Source: "lugar donde esta el archivo de musica"; Flags: dontcopy nocompression
Source: "C:\Program Files (x86)\Inno Setup 5\Dll Pack\bp.dll"; Flags: dontcopy

[Code]
var
mp3HNDL:DWORD;

function BASS_Init(device: Integer; freq, flags, win: DWORD;clsid:integer): Boolean; external 'BASS_Init@{tmp}\BASS.dll stdcall delayload';
function BASS_Free: Boolean; external 'BASS_Free@{tmp}\BASS.dll stdcall delayload';
function BASS_Start: Boolean; external 'BASS_Start@{tmp}\BASS.dll stdcall delayload';
function BASS_Stop: Boolean; external 'BASS_Stop@{tmp}\BASS.dll stdcall delayload';
function BASS_Pause: Boolean; external 'BASS_Pause@{tmp}\BASS.dll stdcall delayload';
function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean; external 'BASS_ChannelPlay@{tmp}\BASS.dll stdcall delayload';
function BASS_ChannelPause(handle:DWORD):Boolean; external 'BASS_ChannelPause@{tmp}\BASS.dll stdcall delayload';
function BASS_ChannelStop(handle:DWORD):Boolean; external 'BASS_ChannelStop@{tmp}\BASS.dll stdcall delayload';

function BASS_StreamCreateFileLib(mem: BOOL; fil: PAnsiChar; offset, length, flags: DWORD): DWORD; external 'BASS_StreamCreateFile@{tmp}\bp.dll stdcall delayload';

function BASS_StreamCreateFile(mem: BOOL; fil: AnsiString; offset, flags: DWORD): DWORD;
var size_:Longint; Buffer:ansistring;
begin
if mem then begin
#ifdef IS_ENHANCED
size_:=ExtractTemporaryFileSize(fil);
SetLength(Buffer,size_);
ExtractTemporaryFileToBuffer(fil,Cast{#defined UNICODE ? "Ansi" : ""}StringToInteger(Buffer));
#else
if not FIleExists(ExpandConstant('{tmp}\')+fil) then ExtractTemporaryFile(fil);
FileSize(fil,size_);
SetLength(Buffer,size_);
LoadStringFromFile(ExpandConstant('{tmp}\')+fil,Bu ffer);
#endif
Result:=BASS_StreamCreateFileLib(mem,Buffer,0,size _,flags);
end else begin
Result:=BASS_StreamCreateFileLib(mem,fil,offset,0, flags);
end;
end;

function InitializeSetup: Boolean;
begin
ExtractTemporaryFile('BASS.dll');
ExtractTemporaryFile('bp.dll');
BASS_Init(-1,44100,0,0,0);
BASS_Start;
#ifdef MEMORY
mp3HNDL:=BASS_StreamCreateFile(TRUE,'sound.mp3',0, 4); // play from memory
#else
ExtractTemporaryFile('sound.mp3');
mp3HNDL:=BASS_StreamCreateFile(FALSE,ExpandConstan t('{tmp}\sound.mp3'),0,4); // play from file
#endif
BASS_ChannelPlay(mp3HNDL,True);
Result:=true;
end;

procedure DeinitializeSetup();
begin
BASS_Stop;
BASS_Free;
end;

los otros 2 archivos bass y bp los coloque en la carpeta del inno del programa como se muestra, pero al ejecutar me tira error "duplicate identifier INITIALIZESETUP" esta es la linea : function InitializeSetup: Boolean;

ingles google:
hi here I found something on the internet, which works for me having the files bass.dll, bp.dll, the audio and the .iss file but when copying it to the program it does not work

codigo....

the other 2 files bass and bp place them in the ino folder of the program as shown, but when executing it pulls me error "duplicate identifier INITIALIZESETUP" this is the line: function InitializeSetup: Boolean;



saludos

Last edited by pakrat2k2; 23-01-2018 at 07:07.
Reply With Quote