Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi BASS Implementierung (https://www.delphipraxis.net/17245-bass-implementierung.html)

CReber 1. Mär 2004 19:15


BASS Implementierung
 
Ich möchte in einem Programm eine *.XM Sounddatei mit einbinden und da dachte ich mir binden wir mal BASS ein ;) Aber irgendwie habe ich keine Ahnung wie genau das funktioniert und wie ich dann entgültig die Datei starten kann....

XM Dateien: http://www.xs4all.nl/~mon/download.htm

Hoffe mir kann jemand helfen... suche schon seid einer Stunde...

Luckie 1. Mär 2004 19:18

Re: BASS Implementierung
 
Da liegen doch sogar Delphi Demos bei oder nicht? Und die Hilfe ist auch ganz gut. Desweitern haben die da ein eigenes Forum.

atreju2oo0 1. Mär 2004 19:23

Re: BASS Implementierung
 
Damit lasse ich mp3 files abspielen...
Code:

 private
    { Private declarations }
    mods: array[0..128] of HMUSIC;
    modc: Integer;
    sams: array[0..128] of HSAMPLE;
    samc: Integer;
    str: HSTREAM;

              procedure Play;

           f := PChar(ListBox1.Items.Strings[ListBox1.Itemindex]);
           str := BASS_StreamCreateFile(FALSE, f, 0, 0, 0);
                // Play stream, not flushed
           if not BASS_StreamPlay(str, FALSE, 0) then
        Error('Can''t play stream');

procedure TForm1.FormCreate(Sender: TObject);
begin

   modc := 0;      // music module count
   samc := 0;      // sample count
   str := 0;      // stream count

   // Ensure BASS 2.0 was loaded
   if BASS_GetVersion() <> MAKELONG(2,0) then begin
      Error('BASS version 2.0 was not loaded!');
      Halt;
   end;

   // Initialize audio - default device, 44100hz, stereo, 16 bits
   if not BASS_Init(1, 44100, 0, Handle, nil) then
      Error('Error initializing audio!');

end;
Für XM Dateien musst Du mal gucken ob die auch als Stream abgespielt werden...
Wenn nicht mußt Du statt
BASS_StreamCreateFile(FALSE, f, 0, 0, 0);
BASS_XXXX

nehmen!
Dafür sind oben auch die Variablen
mods: array[0..128] of HMUSIC;
modc: Integer;
sams: array[0..128] of HSAMPLE;
samc: Integer;
schon mal mit drin...
Das steht mit einem kompletten Delphi Programm aber alles auch in dem SDK drin!

CReber 1. Mär 2004 19:30

Re: BASS Implementierung
 
Zitat:

Zitat von Luckie
Da liegen doch sogar Delphi Demos bei oder nicht? Und die Hilfe ist auch ganz gut. Desweitern haben die da ein eigenes Forum.

Sicherlich für Fortgeschrittene ich fand das arg kompliziert ;)


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:23 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz