How do you play a wave file in delphi with Bass

Started by vidiware, 15 May '03 - 13:01

vidiware

c:\test.wav

Can someone tell me how to play that file everytime button1 is pressend?

(: JOBnik! :)

Hi ;D

There're a lot of examples in BASS package, just choose your programming language that you're using, under the language Directory name and you'll find what you're seeking for :)

Have fun!

8) JOBnik! 8)

vidiware

The problem is not the examples...
but how exactly do you open a file...
im just looking for some code... because im getting the error:

Cardinal and String is incompatible types

Ghostwalker

Simple as posible:

var
  MyStream : HStream;

begin
  mystream :=  Bass_StreamCreateFile(false,Pchar('C:\your.wav'),0,0,0);
  if mystream <> 0 then
    Bass_StreamPlay(MyStream,true,0);
end;

You also can use the BASS_SAMPLE-Functions to do this.

Greetings Ghostwalker


vidiware

Well now i have done that...
how do you initzialize bass and make it ready to play that sound?  ::)

Ghostwalker

Have a closer look to the demos that come with bass. There are the init's for bass. Also the helpfile may help you.:)

vidiware