View Full Version : How to make form play an audio
geerhedd
05-18-2007, 01:39 PM
Hello all, a quick question please, i know that scar has an audio plugin, what im trying to do is add an audio commentary to a form, (push a button on form, and
audio gives you script credits and recommendations for running script), How can i utilize this? I really havent seen too much on any forums or in srl manual about this. any help greatly appreciated. thanx GEERHEDD:bart:
JuKKa
05-18-2007, 02:38 PM
maybe something like this:
program SetupScript;
var
frmDesign : TForm;
Button1 : TButton;
procedure OnClick(Sender: TObject);
begin
PlaySound('C:\Kiss.Wav');
end;
procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.Width := 132;
frmDesign.Height := 96;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.OnClick:= @OnClick
Button1.Left := 21;
Button1.Top := 15;
Button1.Width := 75;
Button1.Height := 25;
Button1.Caption := 'Sound';
Button1.TabOrder := 8;
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
begin
SafeInitForm;
SafeShowFormModal;
end.
now place this file into ur C:\ Drive.(unrar first) now it should play it when u press SOUND on the form.
geerhedd
05-18-2007, 02:52 PM
Thank you very much, ill try that,(is there any way to work sound into script?)
so anybody with script could use? mybe in a string somehow?
JuKKa
05-18-2007, 02:56 PM
Thank you very much, ill try that,(is there any way to work sound into script?)
so anybody with script could use? mybe in a string somehow?
well, u have to ask freddy if he makes that in the next scar version :)
geerhedd
05-18-2007, 03:28 PM
kk thank you i think what im gonna do for right now is link the button to to an external websitefor the commentary and credits.(not enough ppl read the entire script before running,but if they have a button to push........)
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.