[WA] Loop sound

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

[WA] Loop sound

Postby piotr » April 6th, 2004, 8:36 am

Congratulations, WA is very god job.

However, i'm looking for simple method to loop played sounds, when i simply try to add Active:= True in OnDeactivate event, i recived out of memory error.
piotr
Member
Member
 
Posts: 1
Joined: April 6th, 2004, 8:28 am

Postby Kambiz » April 11th, 2004, 2:22 pm

I did it in the following way, and it worked.

Code: Select all
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, WaveIO, WaveOut, WavePlayers;

type
  TForm1 = class(TForm)
    AudioPlayer: TAudioPlayer;
    cbActive: TCheckBox;
    procedure AudioPlayerDeactivate(Sender: TObject);
    procedure cbActiveClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.AudioPlayerDeactivate(Sender: TObject);
begin
  AudioPlayer.Active := cbActive.Checked;
end;

procedure TForm1.cbActiveClick(Sender: TObject);
begin
  AudioPlayer.Active := cbActive.Checked;
end;

end.
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: Bing [Bot] and 31 guests

cron