Quote:
|
Can someone share me an example as how to use .ogg files in IXBass which was supported after xBass.dll v3.0?
|
it's nothing but you need to have decoders next to the '
XBass.dll'. In this case, they are '
ogg.dll' and '
vorbis*.dll'.
* What's new with this release:
1. Compiled in Delphi XE to reduce the file size.
- FileSize: 4.51 MB --> 497 KB (Saved: 90%)
2. Play through memory.
- Since this build, you can play files through memory, instead of having them on the hard drive.
- However, you need to use '
InnoSetup Enhanced Edition' or '
FXStream' to utilize this feature.
Code:
function xbassCreateFromMem(AHandle: HWND; const Buffer: PAnsiChar; const Count, BassType: Cardinal; ASpeed: Single; RepeatOn: Boolean; ACallback: TXBassCallback1): Boolean;
function xbassChangeMem(const Buffer: PAnsiChar; const Count: Cardinal): Boolean;
--------------------------------
type
IXBass = Interface(IUnknown)
'{3A515F05-FBAE-4D1E-80A0-808E6FAF3187}'
...
function FCreateFromMem(AHandle: HWND; const Buffer: PAnsiChar; const Count, BassType: Cardinal; ASpeed: Single; RepeatOn: Boolean; ACallback: TXBassCallback1): Boolean;
function ChangeMem(const Buffer: PAnsiChar; const Count: Cardinal): Boolean;
...
end;
* InnoSetup Enhanced Edition:
Code:
procedure InitializeWizard();
var
Buffer: AnsiString;
Count: Cardinal;
begin
//
Count := ExtractTemporaryFileSize('{#MusicFileOnly}');
SetLength(Buffer, Count);
ExtractTemporaryFileToBuffer('{#MusicFileOnly}', CastAnsiStringToInteger(Buffer));
//
ExtractTemporaryFile('ogg.dll');
ExtractTemporaryFile('vorbis.dll');
ExtractTemporaryFile('vorbisenc.dll');
ExtractTemporaryFile('vorbisfile.dll');
CreateOrChange;
PlayNextBtn.Enabled := False;
PlayPrevBtn.Enabled := False;
if not xbassCreateFromMem(WizardForm.Handle,
Buffer,
Count,
C_XBASS_OGG,
1, True, @MusicCallback) then
MsgBox('XBass - error(s) occured while creating.', mbError, MB_OK);
end;
* FXStream:
Code:
procedure InitializeWizard();
var
Buffer: AnsiString;
Count: Cardinal;
begin
//
Count := FXUnPckrExtractFileSize('{#MusicFileOnly}');
SetLength(Buffer, Count);
FXUnPckrExtractToBuffer2A('{#MusicFileOnly}', Buffer, Count);
//
ExtractTemporaryFile('ogg.dll');
ExtractTemporaryFile('vorbis.dll');
ExtractTemporaryFile('vorbisenc.dll');
ExtractTemporaryFile('vorbisfile.dll');
CreateOrChange;
PlayNextBtn.Enabled := False;
PlayPrevBtn.Enabled := False;
if not xbassCreateFromMem(WizardForm.Handle,
Buffer,
Count,
C_XBASS_OGG,
1, True, @MusicCallback) then
MsgBox('XBass - error(s) occured while creating.', mbError, MB_OK);
{ CleanUp }
FXUnPckrFree;
end;
.