I was unable to get the Beep command to play correctly CONSISTENTLY on this Core I3
laptop. Sometimes it worked perfectly, other times it did not. Often beeps would be dropped.
I can only GUESS that this was from conflict with other processes going on with my system
perhaps some kind of "Race Condition"? I am only a hobbyist programmer so all this is just
uneducated speculation. In any event I rewrote my code to use MMsystem and sndplaysound
using wav files that I created using "Audacity". Everything now works fine and the morse code
executes flawlessly every time. I can only guess that (at least on my laptop) sndplaysound
has a higher execution priority and more perfect timing then the beep command.
Thank You Everyone for your input
SNIPPET OF WORKING CODE
Procedure TForm1.Playit_Click(Sender: TObject);
var z:integer; s2:string;
Begin
S2:=Edit1.text;
For z:=1 to Length(S2) Do
Begin
Case S2[z] of
'.': sndplaysound('.\dot.wav' ,snd_sync);
'-': sndplaysound('.\dash.wav',snd_sync);
Pause_Sound;
end;