The hard way is to keep a list of morse code in your program, and then try to play two dots and a dash for one letter, a dash for another, and so on.
There are 3 thinsg you need to do to get this to work:
a) A section that opens the text file, and processes it one letter at a time.
b) A folder full of ready made WAVS - one for each letter
c) Code to play the WAVS
Assuming you have read the file into a string, and you work though the string letter by letter, just play the WAV which has the same name as the letter.
(A.WAV, N.WAV, T.WAV... and so on)
The code to play a WAV file is
Private Declare Auto Function PlaySound Lib "winmm.dll" _
(ByVal lpszSoundName As String, ByVal hModule As Integer, _
ByVal dwFlags As Integer) As Integer
Private Const SND_FILENAME As Integer = &H20000
Public Function PlayWav(ByVal fileFullPath As String) _
As Boolean
'return true if successful, false if otherwise
Dim bAns As Boolean, iRet As Integer = 0
Try
iRet = PlaySound(fileFullPath, 0, SND_FILENAME)
Catch
End Try
Return iRet
End Function
Enter your message below
Sign in or Join us (it's free).