Programlama yapalım ve Öğrenelim. - Delphi Eğitim219
  Ana Sayfa
  .NET Eğitim Notları
  Visual C# .NET Örnek Kodları
  VisualBasic.NET Örnek Kodları
  J# Örnekleri
  ASP.NET Örnek Kodları
  Delphi Eğitim
  => Delphi Eğitim1
  => Delphi Eğitim2
  => Delphi Eğitim3
  => Delphi Eğitim4
  => Delphi Eğitim5
  => Delphi Eğitim6
  => Delphi Eğitim7
  => Delphi Eğitim8
  => Delphi Eğitim9
  => Delphi Eğitim10
  => Delphi Eğitim11
  => Delphi Eğitim13
  => Delphi Eğitim14
  => Delphi Eğitim15
  => Delphi Eğitim16
  => Delphi Eğitim17
  => Delphi Eğitim18
  => Delphi Eğitim19
  => Delphi Eğitim20
  => Delphi Eğitim21
  => Delphi Eğitim22
  => Delphi Eğitim23
  => Delphi Eğitim24
  => Delphi Eğitim25
  => Delphi Eğitim26
  => Delphi Eğitim27
  => Delphi Eğitim28
  => Delphi Eğitim29
  => Delphi Eğitim30
  => Delphi Eğtim31
  => Delphi Eğitim32
  => Delphi Eğitim33
  => Delphi Eğitim34
  => Delphi Eğitim35
  => Delphi Eğitim36
  => Delphi Eğitim37
  => Delphi Eğitim38
  => Delphi Eğitim39
  => Delphi Eğitim40
  => Delphi Eğitim41
  => Delphi Eğitim42
  => Delphi Eğitim43
  => Delphi Eğitim44
  => Delphi Eğitim45
  => Delphi Eğitim46
  => Delphi Eğitim47
  => Delphi Eğitim48
  => Delphi Eğitim49
  => Delphi Eğitim50
  => Delphi Eğitim51
  => Delphi Eğitim52
  => Delphi Eğitim53
  => Delphi Eğitim54
  => Delphi Eğitim55
  => Delphi Eğitim56
  => Delphi Eğitim57
  => Delphi Eğitim58
  => Delphi Eğitim59
  => Delphi Eğitim60
  => Delphi Eğitim61
  => Delphi Eğitim62
  => Delphi Eğitim63
  => Delphi Eğitim64
  => Delphi Eğitim65
  => Delphi Eğitim66
  => Delphi Eğitim67
  => Delphi Eğitim68
  => Delphi Eğitim69
  => Delphi Eğitim70
  => Delphi Eğitim71
  => Delphi Eğitim72
  => Delphi Eğitim73
  => Delphi Eğitim74
  => Delphi Eğitim75
  => Delphi Eğitim76
  => Delphi Eğitim77
  => Delphi Eğitim78
  => Delphi Eğitim79
  => Delphi Eğitim80
  => Delphi Eğitim81
  => Delphi Eğitim82
  => Delphi Eğitim83
  => Delphi Eğitim84
  => Delphi Eğitim85
  => Delphi Eğitim86
  => Delphi Eğitim87
  => Delphi Eğitim88
  => Delphi Eğitim89
  => Delphi Eğitim90
  => Delphi Eğitim91
  => Delphi Eğitim92
  => Delphi Eğitim93
  => Delphi Eğitim94
  => Delphi Eğitim95
  => Delphi Eğitim96
  => Delphi Eğitim97
  => Delphi Eğitim98
  => Delphi Eğitim99
  => Delphi Eğitim100
  => Delphi Eğitim101
  => Delphi Eğitim102
  => Delphi Eğitim103
  => Delphi Eğitim104
  => Delphi Eğitim105
  => Delphi Eğitim106
  => Delphi Eğitim107
  => Delphi Eğitim108
  => Delphi Eğitim109
  => Delphi Eğitim110
  => Delphi Eğitim111
  => Delphi Eğitim112
  => Delphi Eğitim113
  => Delphi Eğitim114
  => Delphi Eğitim115
  => Delphi Eğitim116
  => Delphi Eğitim117
  => Delphi Eğitim118
  => Delphi Eğitim119
  => Delphi Eğitim120
  => Delphi Eğitim121
  => Delphi Eğitim122
  => Delphi Eğitim123
  => Delphi Eğitim124
  => Delphi Eğitim125
  => Delphi Eğitim126
  => Delphi Eğitim127
  => Delphi Eğitim128
  => Delphi Eğitim129
  => Delphi Eğitim130
  => Delphi Eğitim131
  => Delphi Eğitim132
  => Delphi Eğitim133
  => Delphi Eğitim134
  => Delphi Eğitim135
  => Delphi Eğitim136
  => Delphi Eğitim137
  => Delphi Eğitim138
  => Delphi Eğitim139
  => Delphi Eğitim140
  => Delphi Eğitim141
  => Delphi Eğitim142
  => Delphi Eğitim143
  => Delphi Eğitim144
  => Delphi Eğitim145
  => Delphi Eğitim146
  => Delphi eğitim147
  => Delphi Eğitim148
  => Delphi Eğitim149
  => Delphi Eğitim150
  => Delphi Eğitim151
  => Delphi Eğitim152
  => Delphi Eğitim153
  => Delphi Eğitim154
  => Delphi Eğitim155
  => Delphi Eğitim156
  => Delphi Eğitim157
  => Delphi Eğitim158
  => Delphi Eğitim159
  => Delphi Eğitim160
  => Delphi Eğitim161
  => Delphi Eğitim162
  => Delphi Eğitim164
  => Delphi Eğitim165
  => Delphi Eğitim166
  => Delphi Eğitim167
  => Delphi Eğitim168
  => Delphi Eğitim169
  => Delphi Eğitim170
  => Delphi Eğitim171
  => Delphi Eğitim172
  => Delphi Eğitim173
  => Delphi Eğitim174
  => Delphi Eğitim175
  => Delphi Eğitim176
  => Delphi Eğitim177
  => Delphi Eğitim178
  => Delphi Eğitim179
  => Delphi Eğitim180
  => Delphi Eğitim181
  => Delphi Eğitim182
  => Delphi Eğitim183
  => Delphi Eğitim184
  => Delphi Eğitim185
  => Delphi Eğitim186
  => Delphi Eğitim187
  => Delphi Eğitim188
  => Delphi Eğitim189
  => Delphi Eğitim190
  => Delphi Eğitim191
  => Delphi Eğitim192
  => Delphi Eğitim193
  => Delphi Eğitim194
  => Delphi Eğitim195
  => Delphi Eğitim196
  => Delphi Eğitim197
  => Delphi Eğitim198
  => Delphi Eğitim199
  => Delphi Eğitim200
  => Delphi Eğitim201
  => Delphi Eğitim202
  => Delphi Eğitim203
  => Delphi Eğitim204
  => Delphi Eğitim205
  => Delphi Eğitim206
  => Delphi Eğitim207
  => Delphi Eğitim208
  => Delphi Eğitim209
  => Delphi Eğitim210
  => Delphi Eğitim211
  => Delphi Eğitim212
  => Delphi Eğitim213
  => Delphi Eğitim214
  => Delphi Eğitim215
  => Delphi Eğitim216
  => Delphi Eğitim217
  => Delphi Eğitim218
  => Delphi Eğitim219
  => Delphi Eğitim220
  => Delphi Eğitim221
  => Delphi Eğitim222
  => Delphi Eğitim223
  => Delphi Eğitim224
  => Delphi Eğitim225
  => Delphi Eğitim226
  => Delphi Eğitim227
  => Delphi Eğitim228
  => Delphi Eğitim229
  => Delphi Eğitim230
  => Delphi Eğitim231
  => Delphi Eğitim232
  => Delphi Eğitim233
  => Delphi Eğitim234
  => Delphi Eğitim235
  => Delphi Eğitim236
  => Delphi Eğitim237
  => Delphi Eğitim238
  => Delphi Eğitim239
  => Delphi Eğitim240
  => Delphi Eğitim241
  => Delphi Eğitim242
  İletişim

 

bilgisayarı kendi sesinizle konuşturun

unit Unit1;

 

interface

 

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  MMSystem, StdCtrls, Buttons, ComCtrls, Gauges, ExtCtrls, jpeg;

 

type

  TForm1 = class(TForm)

    ReadBtn: TBitBtn;

    ExitBtn: TBitBtn;

    StopBtn: TBitBtn;

    OpenBtn: TBitBtn;

    OpenDialog1: TOpenDialog;

    ClearBtn: TBitBtn;

    HelpBtn: TBitBtn;

    Memo1: TMemo;

    Image1: TImage;

    Label1: TLabel;

    Label2: TLabel;

    Timer1: TTimer;

    procedure ReadBtnClick(Sender: TObject);

    procedure FormCreate(Sender: TObject);

    procedure ExitBtnClick(Sender: TObject);

    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);

    procedure OpenBtnClick(Sender: TObject);

    procedure StopBtnClick(Sender: TObject);

    procedure ClearBtnClick(Sender: TObject);

    procedure HelpBtnClick(Sender: TObject);

    procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;

      Shift: TShiftState; X, Y: Integer);

    procedure Timer1Timer(Sender: TObject);

 

    private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

  Ext:Boolean;

  DirPath:string;

 

implementation

 

uses Unit2;

 

{$R *.DFM}

 

procedure TForm1.ReadBtnClick(Sender: TObject);

var

   c,c1,c2:Char;

   txt:String;

   i:Integer;

begin

     Ext:=False;

     Memo1.setfocus;

     if memo1.Text =" then Exit;

     OpenBtn.Enabled:=False;

     ReadBtn.Enabled:=False;

     StopBtn.Enabled:=True;

     ClearBtn.Enabled:=False;

     i:=0;

     if Memo1.SelLength<>0 then Txt:=Memo1.seltext

     else Txt:=memo1.text;

     while i<=Length(Txt) do begin

       i:=i+1;

         Application.ProcessMessages;

         If Ext=True then break;

         c:=Txt[i];

         Case c of

 

              'q','Q':Playsound('Q',hInstance,snd_resource or snd_NoStop);

              'w','W':Playsound('w',hInstance,snd_resource or snd_NoStop);

              'e','E':

                      begin

                           c1:=Txt[i+1];

                           if ((c1='i') or (c1='I')) Then begin

                              PlaySound('i',hInstance,snd_resource or snd_NoStop);

                              i:=i+1;

                              end

                           else if ((c1='u') or (c1='U')) Then begin

                                PlaySound('U',hInstance,snd_resource or snd_NoStop);

                                i:=i+1;

                           end

                           else

                               PlaySound('E',hInstance,snd_resource or snd_NoStop);

                      end;

              'r','R':PlaySound('R',hInstance,snd_resource or snd_NoStop);

              't','T':

                      begin

                           c1:=Txt[i+1];

                           if (c1='h') or (c1='H') then begin

                              PlaySound('T',hInstance,snd_resource or snd_NoStop);

                              i:=I+1;

                           end

                           else PlaySound('T',hInstance,snd_resource or snd_NoStop);

                      end;

              'y','Y':PlaySound('Y',hInstance,snd_resource or snd_NoStop);

              'u','U':

                      begin

                           c1:=Txt[i+1];

                           if (c1='e') or (c1='E') then begin

                              PlaySound('ue',hInstance,snd_resource or snd_NoStop);

                              i:=I+1;

                           end

                           else PlaySound('U',hInstance,snd_resource or snd_NoStop);

                      end;

              'i','I':

                      begin

                           c1:=Txt[i+1];

                           c2:=Txt[i+2];

                           if (c1='E') or (c1='e') then begin

                              PlaySound('ie',hInstance,snd_resource or snd_NoStop);

                              i:=I+1;

                           end

                           else if ((c1='s') or (c1='S')) and ((c2='t') or (c2='T') or

                                (c2='s') or (c2='S')) then begin

                                PlaySound('I',hInstance,snd_resource or snd_NoStop);

                                PlaySound('s',hInstance,snd_resource or snd_NoStop);

                                i:=i+1;

                                if (c2='s') or (c2='S') then i:=i+1;

                           end

                           else

                               PlaySound('I',hInstance,snd_resource or snd_NoStop);

                      end;

              'o','O':

                      begin

                           c1:=Txt[i+1];

                           if (c1='s') or (c1='S') then begin

                                PlaySound('O',hInstance,snd_resource or snd_NoStop);

                                PlaySound('s',hInstance,snd_resource or snd_NoStop);

                                i:=i+1;

                           end

                           else

                               PlaySound('O',hInstance,snd_resource or snd_NoStop);

                      end;

              'p','P':PlaySound('P',hInstance,snd_resource or snd_NoStop);

              'a','A':

                      begin

                           c1:=Txt[i+1];

                           if (c1='a') or (c1='A') then begin

                              PlaySound('a',hInstance,snd_resource or snd_NoStop);

                              i:=i+1;

                           end

                           else

                               PlaySound('A',hInstance,snd_resource or snd_NoStop);

                      end;

              's','S':

                      begin

                           c1:=Txt[i+1];

                           c2:=Txt[i+2];

                           if ((c1='c') or (c1='C')) and ((c2='h') or (c2='H')) then begin

                              PlaySound('ch',hInstance,snd_resource or snd_NoStop);

                              i:=i+2;

                           end

                           else if (Txt[i-1]='s') or (Txt[i-1]='S') then begin

                                PlaySound('s',hInstance,snd_resource or snd_NoStop);

                           end

                           else if (c1='s') or (c1='S') then begin

                                PlaySound('s',hInstance,snd_resource or snd_NoStop);

                                i:=i+1;

                           end

                           else if ((c1='t') or (c1='T')) and ((Txt[i-1]=") or (Txt[i-1]=' ')) then begin

 

                                PlaySound('t',hInstance,snd_resource or snd_NoStop);

                           end

                           else if ((c1='p') or (c1='P')) and ((Txt[i-1]=") or (Txt[i-1]=' ')) then begin

                                PlaySound('p',hInstance,snd_resource or snd_NoStop);

                           end

                           else if (c1=' ') or (c1='.') or (c1=',') or (c1='!') or

                                   (c1=':') or (c1=';') or (c1='?') or (c1='"') or

                                   (c1=") then begin

                                PlaySound('s',hInstance,snd_resource or snd_NoStop);

                                i:=i+1;

                           end

                           else

                               PlaySound('z',hInstance,snd_resource or snd_NoStop);

                      end;

              'd','D':PlaySound('D',hInstance,snd_resource or snd_NoStop);

              'f','F':PlaySound('F',hInstance,snd_resource or snd_NoStop);

              'g','G':PlaySound('G',hInstance,snd_resource or snd_NoStop);

              'h','H':PlaySound('H',hInstance,snd_resource or snd_NoStop);

              'j','J':PlaySound('i',hInstance,snd_resource or snd_NoStop);

              'k','K':PlaySound('K',hInstance,snd_resource or snd_NoStop);

              'l','L':PlaySound('L',hInstance,snd_resource or snd_NoStop);

              'z','Z':PlaySound('Z',hInstance,snd_resource or snd_NoStop);

              'x','X':PlaySound('X',hInstance,snd_resource or snd_NoStop);

              'c','C':

                      begin

                           c1:=Txt[i+1];

                           c2:=Txt[i+2];

                           if (c1='h') or (c1='H') then begin

                              if (Txt[i-1]='u') or (Txt[i-1]='U') or

                                 (Txt[i-1]='a') or (Txt[i-1]='A') then begin

                                   PlaySound('k',hInstance,snd_resource or snd_NoStop);

                                   PlaySound('h',hInstance,snd_resource or snd_NoStop);

                                   i:=I+1;

                              end

                              else if (c2='s') or (c2='S') then begin

                                   PlaySound('k',hInstance,snd_resource or snd_NoStop);

                                   i:=I+1;

                              end

                              else begin

                                 PlaySound('ch',hInstance,snd_resource or snd_NoStop);

                                 i:=i+1;

                              end;

                           end

                           else if (c1='k') or (c1='K') then begin

                                PlaySound('k',hInstance,snd_resource or snd_NoStop);

                                i:=i+1;

                           end

                           else if (c1='e') or (c1='E') or (c1='i') or (c1='I') then begin

                                PlaySound('z',hInstance,snd_resource or snd_NoStop);

                           end

                           else if (c1='o') or (c1='O') then begin

                                PlaySound('k',hInstance,snd_resource or snd_NoStop);

                           end

                           else

                               PlaySound('k',hInstance,snd_resource or snd_NoStop);

                      end;

              'v','V':PlaySound('f',hInstance,snd_resource or snd_NoStop);

              'b','B':PlaySound('B',hInstance,snd_resource or snd_NoStop);

              'n','N':PlaySound('N',hInstance,snd_resource or snd_NoStop);

              'm','M':PlaySound('M',hInstance,snd_resource or snd_NoStop);

              'ö','Ö':PlaySound('O',hInstance,snd_resource or snd_NoStop);

              'ü','Ü':PlaySound('Ue',hInstance,snd_resource or snd_NoStop);

              'ä','Ä':

                      begin

                           c1:=Txt[i+1];

                           if (c1='u') or (c1='U') then begin

                              PlaySound('u',hInstance,snd_resource or snd_NoStop);

                              i:=i+1;

                           end

                           else

                               PlaySound('A',hInstance,snd_resource or snd_NoStop);

                      end;

              'ß':PlaySound('S',hInstance,snd_resource or snd_NoStop);

              ' ': sleep(400);

              else Sleep(400);

         end;

     end;

 

     OpenBtn.Enabled:=True;

     ReadBtn.Enabled:=True;

     StopBtn.Enabled:=False;

     ClearBtn.Enabled:=True;

end;

 

procedure TForm1.FormCreate(Sender: TObject);

var h,m,s,ms:word;

    hour:integer;

begin

     Ext:=False;

     Decodetime(Time,h,m,s,ms);

     hour:=h;

     If (hour<12) then Memo1.text:='gunaydın'

     else if (hour>=12) and (hour<18) then Memo1.text:='merhaba'

     else if (hour>=18) then Memo1.text:='iyi aksamlar';

     Memo1.SelStart:=Length(Memo1.text);

     DirPath:=ExtractFilePath(Application.ExeName);

     Form1.Width:=Image1.width;

     Form1.Height:=Image1.Height;

     Label2.Caption:=FormatDateTime('hh:mm:ss',Time);

     Form1.Show;

     ReadBtnClick(nil);

end;

 

procedure TForm1.ExitBtnClick(Sender: TObject);

begin

     Ext:=True;

     close;

end;

 

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);

begin

     If Ext=True then CanClose:=True

     Else CanClose:=False;

end;

 

 

procedure TForm1.OpenBtnClick(Sender: TObject);

begin

     OpenDialog1.InitialDir:=DirPath;

     OpenDialog1.Execute;

     if OpenDialog1.FileName<>" then begin

        try

           Memo1.Lines.LoadFromFile(OpenDialog1.FileName);

           Label1.Caption:='File name: "'+OpenDialog1.FileName+'"';

           DirPath:=ExtractFilePath(OpenDialog1.FileName);

        except

              messagebox(handle,'uzun dosya!','dosya açma hatası',MB_OK + MB_IconStop);

        end;

     end;

end;

 

procedure TForm1.StopBtnClick(Sender: TObject);

begin

     Ext:=True;

     OpenBtn.Enabled:=True;

     ReadBtn.Enabled:=True;

     StopBtn.Enabled:=False;

     ClearBtn.Enabled:=True;

end;

 

procedure TForm1.ClearBtnClick(Sender: TObject);

begin

     Label1.Caption:='dosya adı:"adsız"';

     Memo1.Text:=";

     Memo1.SetFocus;

end;

 

procedure TForm1.HelpBtnClick(Sender: TObject);

begin

     Form2.showmodal;

end;

 

procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;

  Shift: TShiftState; X, Y: Integer);

begin

     ReleaseCapture;

     Form1.Perform(WM_SysCommand,$f012,0);

end;

 

procedure TForm1.Timer1Timer(Sender: TObject);

begin

     Label2.Caption:=FormatDateTime('hh:mm:ss',Time);

end;

 

 

 

end.

Bu web sitesi ücretsiz olarak Bedava-Sitem.com ile oluşturulmuştur. Siz de kendi web sitenizi kurmak ister misiniz?
Ücretsiz kaydol