Autor Beitrag
GR-Thunderstorm
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 206



BeitragVerfasst: So 28.05.06 17:33 
Ich habe für die Gehbewegung der Figur in meinem Spiel einen Sound eingefügt der mit einem Timer alle 200ms abgespielt wird. Allerdings hab ich das Problem, dass sich manchmal irgendwelche Störgeräusche dazwischen mogeln wenn man ein paar Schritte gelaufen ist bzw manchmal stockt der Sound für eine Sekunde und wird nur noch total abgehackt abgespielt.
Kann man das irgendwie beheben?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
 begin
  if key = 'd' then
   begin
    SoundTime.Enabled:=true;
    image1.Left:=image1.left+3;
   end;
 end;



procedure TForm1.SoundTimeTimer(Sender: TObject);
 begin
  SoundTime.Interval:=200;
  MediaPlayer.Play;
 end;
Xion
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
EE-Maler
Beiträge: 1952
Erhaltene Danke: 128

Windows XP
Delphi (2005, SmartInspect), SQL, Lua, Java (Eclipse), C++ (Visual Studio 2010, Qt Creator), Python (Blender), Prolog (SWIProlog), Haskell (ghci)
BeitragVerfasst: So 28.05.06 17:39 
Lädst du die Sounddatei irgendwo (MediaPlayer1.Open)? Sonst muss er sie jedesmal neu laden => ggf. Störgeräusche

_________________
a broken heart is like a broken window - it'll never heal
In einem gut regierten Land ist Armut eine Schande, in einem schlecht regierten Reichtum. (Konfuzius)
GR-Thunderstorm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 206



BeitragVerfasst: So 28.05.06 17:54 
Ich hab beim MediaPlayer unter "Filename" die Datei ausgewählt. Wie kann man es denn sonst machen?
GR-Thunderstorm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 206



BeitragVerfasst: Di 30.05.06 16:22 
Die Fehler kommen auch, wenn ich den Sound nur alle 5 Sekunden oder so abspielen lasse, und dann wirds von mal zu mal schlimmer und immer verknirrschter... :cry:

Woran kann das liegen?