���� ���� ������ ������� ���� 6 �� ����� ������� ���� ������� ��� ����

��� ������� Module � ����� ���

������� ��� ��� ���� ����� ���� ���� ����� ���� ������ ������� Module ��� ���� ������� ������ �� ���� Form � ���� ���� �� ������� ���� ����� (API)������� �� �������

�� ���� ����� ������� ������  � �� ��� ������ ������� � �� ������ ������ ������ :

�� ������� Add Module �� ����� Project:

����� �� ��� ������� ���� ���� Open  

����� �� ��� ������

 

 ��� �� ���� ��� ������ � ������ ����� Module1 ���� ������ ������� :

Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Option Explicit

Public Sub PSound(FName As String, Optional gAsync As Boolean = True, Optional gLoop As Boolean = False)
Dim Flag&

If FName = "" Then
sndPlaySound 0&, 0
Else
If gAsync = True Then Flag = Flag Or 1
If gLoop = True Then Flag = Flag Or 8
sndPlaySound FName, Flag
End If

End Sub

� ����� ��� ����� ������ :

� ��� ��� �� ���� (�� ������ ��� ���� ���� ���� �� ������ ��� ��������)

Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

��� ��� ���� ���� Api ����� �� ����� WAV  � �����  sndPlaySoundA ��� ������ ��� ���� winmm.dll ����� ������ �����
Option Explicit
��� ������ ����� ��� ����� ��������� ��� �� ���� ����� ���������

Public Sub PSound(FName As String, Optional gAsync As Boolean = True, Optional gLoop As Boolean = False)

���  ����� ���� ����� ����� PSound  � ����� ��� ��� ����� ����� ���� ��� ����� � �� FName  � ���� True �� False �������

Dim Flag&

If FName = "" Then
sndPlaySound 0&, 0
Else
If gAsync = True Then Flag = Flag Or 1
If gLoop = True Then Flag = Flag Or 8
sndPlaySound FName, Flag
End If

����� ����� ����� ����� ���� Flag&  �� ���� ���� ����� ��� ���  ����� ���� ���� ����� � ��� �� ����� ���� ����� �� ���� ���� �����

End Sub

��� Sub

 

� ���� ��� ����� ��������� ����� ������� �� �������� ������� :

PSound App.Path + "\s.Wav"

��� PSound  �� ��� ������  ���� ������� (��Module1 )���� ����� �� �� App.Path ���� ������ ���� ����� �� ���� ����� ��� C:\folder  � + �� ���� ���� ������ �������  "\s.Wav" � ����� \ ����� ���� ��� ����� � ��� s �� ��� ����� ������ �  � �� ���� ����� ����� ������ � �� wav � �� ���� ����� (.) .

� ��� ���� ����� ����� ���� ����� ���� ��� �����

PSound App.Path + "\s.Wav", True, True

� ��� ��� ���� ��� ����� ���� ��� ������

PSound ""

 

� ���� ������� ������ ��������� ������ �� ������ �� ��� ����� ���� ���� ��� (t)� ��� ��� ��� �� ������� ����� � ���� (f)  � �� ������� � ���� �� ��� ���� �������� ������ ������� ������ .

� ���� ��� ���� �� ���� ��������� ���� ��� ���� ����� ����� ���� ������� ����� � ����� ��� ���� ����� ���� ��� ��� :

  ���� ���� ������ ��� ���� Command1  � �� �������� �� ����� ���� �� ��� �� ����� :

Private Sub Command1_Click()

If a1 Mod 2 = 0 Then
Label4 = Val(Label4.Caption) + 1
PSound App.Path + "\t.Wav"
Else
Label3 = Val(Label3.Caption) + 1
PSound App.Path + "\f.Wav"
End If
Command1.Enabled = False

End Sub

��� ���� ������ ������ ���� ��� ������� ������� � ������ ���� ��� ������� ������� .

��� ������� �� ���� ������� ���� ��� ����� ����� � ����� � ��� �������� .

 

���� ����� �������� � ����� ��� ������ ����� ���� .

������ ���� ��� :  ��� �� ���� ����� �� ����� wav .

 

������� ���� :  ����� �������� ������ �� ������ ���� ���� � ����� ��� ������ ����

 

���� ����� ������ ������ ���������@2006