Autor Beitrag
matzerg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 70

Win XP
D6 Pers
BeitragVerfasst: So 31.10.04 18:41 
ich habe folgendes problem :
wenn ich ein lvl initialisiere startet sich meine hintergrundmusik für das entsprechende lvl
ausblenden Delphi-Quelltext
1:
2:
3:
           //hintergrundmusik laden
           PlaySound(nil, 0, SND_PURGE);
           PlaySound(PChar('C:\projekt\musik\hg\lvl2.wav'), 0, SND_ASYNC or SND_NODEFAULT);


wenn ich nun ein ziel abschiesse soll ein Sound ausgegeben werden und bei einem Treffer ein anderer noch dazu...

ausblenden volle Höhe Delphi-Quelltext
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:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
procedure TForm1.treffertimerTimer(Sender: TObject);
var zufall :integer;
begin
  randomize;
  zufall:=random(7);
  case zufall of
  0  : begin
         PlaySound(PChar('C:\projekt\musik\treffer\treffer1.wav'), 0, SND_ASYNC or SND_NODEFAULT);
       end;
  1  : begin
         PlaySound(PChar('C:\projekt\musik\treffer\treffer2.wav'), 0, SND_ASYNC or SND_NODEFAULT);
       end;
  2  : begin
         PlaySound(PChar('C:\projekt\musik\treffer\treffer3.wav'), 0, SND_ASYNC or SND_NODEFAULT);
       end;
  3  : begin
         PlaySound(PChar('C:\projekt\musik\treffer\treffer4.wav'), 0, SND_ASYNC or SND_NODEFAULT);
       end;
  4  : begin
         PlaySound(PChar('C:\projekt\musik\treffer\treffer5.wav'), 0, SND_ASYNC or SND_NODEFAULT);
       end;
  5  : begin
         PlaySound(PChar('C:\projekt\musik\treffer\treffer6.wav'), 0, SND_ASYNC or SND_NODEFAULT);
       end;
  6  : begin
         PlaySound(PChar('C:\projekt\musik\treffer\treffer7.wav'), 0, SND_ASYNC or SND_NODEFAULT);
       end;
  7  : begin
         PlaySound(PChar('C:\projekt\musik\treffer\treffer8.wav'), 0, SND_ASYNC or SND_NODEFAULT);
       end;
  end;
  treffertimer.Enabled:=false;
end;
procedure TForm1.schusstimerTimer(Sender: TObject);
begin
  case runde of
  1..3  : begin
            PlaySound(PChar('C:\projekt\musik\Waffen\wpn1shot.wav'), 0, SND_ASYNC or SND_NODEFAULT);
          end;
  4..6  : begin
            PlaySound(PChar('C:\projekt\musik\Waffen\wpn2shot.wav'), 0, SND_ASYNC or SND_NODEFAULT);
          end;
  7..9  : begin
             PlaySound(PChar('C:\projekt\musik\Waffen\wpn3shot.wav'), 0, SND_ASYNC or SND_NODEFAULT);
          end;
  10..12  : begin
              PlaySound(PChar('C:\projekt\musik\Waffen\wpn4shot.wav'), 0, SND_ASYNC or SND_NODEFAULT);
            end;
  13..15  : begin
              PlaySound(PChar('C:\projekt\musik\Waffen\wpn5shot.wav'), 0, SND_ASYNC or SND_NODEFAULT);
            end;
  16..18  : begin
              PlaySound(PChar('C:\projekt\musik\Waffen\wpn6shot.wav'), 0, SND_ASYNC or SND_NODEFAULT);
            end;
  end;
  schusstimer.Enabled:=false;
end;


das habe ich damit auch erreicht nur wird immer wenn ich schiesse die hintergrundmusik Deaktiviert.....
herzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 168

WINXP pro, SUSE Linux 9.0
D7 Pers.
BeitragVerfasst: Mo 01.11.04 12:49 
genau weil das mit den Standard Units nicht möglich ist..

bei deinem Problem kann dir DelphiX,Bass 2.0(www.un4seen.com/) oder FMod bestens helfen. Würde ich sowieso nehmen!

MFG

Herzi
matzerg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 70

Win XP
D6 Pers
BeitragVerfasst: Mo 01.11.04 16:46 
hab delphiX und es hat mir nix gebracht.... vielleicht meinse DXWave oder etwa DXSound oder irgendwas anderes was genau so unverständlich ist und in der Hilfe nicht einml annähernd erwähnt wird....

tut mir leid aber ohne Bsp oder eine erklärung kann ich mit dem nix aber auch jaaar nix anfangen!!!
herzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 168

WINXP pro, SUSE Linux 9.0
D7 Pers.
BeitragVerfasst: Di 02.11.04 11:07