Autor Beitrag
hibbert
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Mi 08.03.06 14:03 
Hi,
ich benutze folgendes um eine .wav Datei im Loop abzuspielen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
uses MMSystem;

procedure TForm1.FormCreate(Sender: TObject);
var flag:word;
begin
  flag:= SND_ASYNC Or SND_LOOP;
  sndPlaySound(PChar('c:\test.wav'),flag);
end;

Nun das funktioniert auch ganz gut, nun möchte ich aber parralel dazu noch einen Sound abspielen, das habe ich mit einem Timer gemacht:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.Timer1Timer(Sender: TObject);
var flag:word;
begin
  flag:= SND_ASYNC;
  sndPlaySound('C.\test2.wav',flag);
end;

Sobald der Sound aus dem Timer abgespielt wird, stoppt der andere sound auch. Kann ich mit dieser Metode nur einen Sound abspielen, oder geht das auch mit mehreren gleichzeitig ?

thx hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 08.03.06 19:47 

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Mi 08.03.06 20:41 
zu dumm nur....
Die Fehlermeldung hat folgendes geschrieben:
Gerät ist nicht geöffnet oder wird vom MCI nicht erkannt.

bei folgendem:
ausblenden 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:
uses
  MMSystem;

procedure SendMCICommand(Cmd: string);
var
  RetVal: Integer;
  ErrMsg: array[0..254] of char;
begin
  RetVal := mciSendString(PChar(Cmd), nil, 0, 0);
  if RetVal <> 0 then
  begin
    {get message for returned value}
    mciGetErrorString(RetVal, ErrMsg, 255);
    MessageDlg(StrPas(ErrMsg), mtError, [mbOK], 0);
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
SendMCICommand('open waveaudio shareable');
SendMCICommand('play "D:\Eigene Dateien\energy\electric_loop.wav"');
SendMCICommand('close waveaudio');
end;


und nu ? :?

hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 08.03.06 20:56 
Es gehen keine Wav-Dateien und keine Pfadangaben mit Leerzeichen.
(Steht in den Kommentaren und hab ich selbst ausprobiert)

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Mi 08.03.06 21:34 
user profile iconGTA-Place hat folgendes geschrieben:
Es gehen keine Wav-Dateien und keine Pfadangaben mit Leerzeichen.
(Steht in den Kommentaren und hab ich selbst ausprobiert)


Na dann hilft mir das nicht weiter...

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej