Hallo!
Ich habe noch ein Problem.
Ich brauche ganz banale Töne (Frequenz plus Dauer) .... also einen
Ersatz für das Sound+Delay+NoSound aus Turbo-Pascal ...
- Für neuere Windowsversionen brauche ich komplett eine Lösung.
- Für ältere Windowsversionen (98+95) habe ich ein Tool aus einem
Handbuch.
Das funktioniert auch, allerdings muß ich dazu die Bereichsprüfung
ausschalten, da es sonst ne Fehlermeldung gibt.(Ärger! Würg!)
Nachfolgend das Tool (bzw. die Tools)
Somebody help me?
SagitariusA
--------------------------------------------------------------------
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45:
| function TForm1.GetPort(address:word):byte; asm mov dx, address in al, dx mov result, al end;
procedure TForm1.SetPort(address: word; Value:byte); var b : byte; begin b := (value and 255); asm mov dx, address mov al, b out dx, al end; end;
procedure TForm1.WinSound(freq,time:word); VAR li:LongInt; b:Byte; Begin if freq > 18 then begin freq := Word(1193181 div LongInt(Freq)); B := GetPort($61); if (B and 3) = 0 then begin SetPort($61,B or 3); SetPort($43,$B6); end; // hier Bereichsprüfungs-Fehler-Meldung SetPort($42,Freq); SetPort($42,Freq shr 8 ) ; end; li:=GetTickCount; repeat Application.ProcessMessages; until ((GetTickCount-li) >= LongInt(time)); SetPort($61,GetPort($61) and $FC); end |
Moderiert von
Aya: Code-Tags hinzugefügt