Rabu, 21 Maret 2012

Pemutar file WAV simple

Dilihat dari judulnya pun ya memang fungsinya hanya untuk memutar file wav,yang amat sangat sederhana,maklum belajar
liat aja skrinsutnya

tapi semoga bermanfaat

membuatnya sangat mudah,bahannya hanya 1 buah edit text,3 bitbutton dan 1 buah opendialog,
sebelumnya jangan lupa tambahkan Uses MMSystem ppada Uses nya. nah nih full source code nya gan

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, MMSystem, StdCtrls, Buttons;

type
  TForm1 = class(TForm)
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    Edit1: TEdit;
    od: TOpenDialog;
    Label1: TLabel;
    SpeedButton3: TSpeedButton;
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
if od.Execute then
  edit1.Text:=od.Filename
else
  exit;
end;

procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
if edit1.Text = '' then
  showmessage('pilih dulu wav soundnya')
else
  PlaySound(PChar(edit1.Text),0,SND_NODEFAULT Or SND_ASYNC);
end;

procedure TForm1.SpeedButton3Click(Sender: TObject);
begin
  sndPlaySound(nil, 0); // Stops the sound
end;

end.  
kalau mau unduh projeknya silahkan unduh aja disini

0 komentar:

Posting Komentar

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes