View Single Post
  #8  
Old 14-07-2024, 07:19
BLACKFIRE69's Avatar
BLACKFIRE69 BLACKFIRE69 is offline
Registered User
 
Join Date: Mar 2019
Location: In the Hell
Posts: 695
Thanks: 482
Thanked 2,579 Times in 567 Posts
BLACKFIRE69 is on a distinguished road
Arrow XBass_f v4.1

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;

.
Attached Images
File Type: png 00.png (20.7 KB, 162 views)
File Type: png 01.png (19.4 KB, 165 views)
Attached Files
File Type: rar XBass_f v4.1 - [build 2024-July-13].rar (3.97 MB, 19 views)
Reply With Quote
The Following 7 Users Say Thank You to BLACKFIRE69 For This Useful Post:
audiofeel (14-07-2024), Ele (16-08-2024), Fak Eid (18-07-2024), hitman797 (14-07-2024), Lord.Freddy (14-07-2024), ScOOt3r (14-07-2024), y_thelastknight (03-08-2024)