���� ���� ������ ������� ���� 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 |
� ����� ��� ����� ������ :
� ��� ��� �� ���� (�� ������ ��� ���� ���� ���� �� ������ ��� ��������)
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& |
����� ����� ����� ����� ���� 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() |
��� ���� ������ ������ ���� ��� ������� ������� � ������ ���� ��� ������� ������� .
��� ������� �� ���� ������� ���� ��� ����� ����� � ����� � ��� �������� .
���� ����� �������� � ����� ��� ������ ����� ���� .
������ ���� ��� : ��� �� ���� ����� �� ����� wav .
������� ���� : ����� �������� ������ �� ������ ���� ���� � ����� ��� ������ ����
���� ����� ������ ������ ���������@2006 |