Autor Beitrag
DaKirsche
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 187

Win XP Pro, SuSe Linux 7.3 - 10.2, Win 2k3 Server, Win 2000, Win NT 4.0
Delphi 2006 Pro, Java, HTML, SQL, PHP, CSS
BeitragVerfasst: Sa 13.05.06 16:12 
Einfaches Datei abspielen :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
uses mmsystem;

procedure TFOrm1.Button1Click(Sender : TObject);
begin
sndplaysound('song.wav',snd_async); //wenn Lied nicht mit weiterem Programmablauf synchronisieren soll

sndplaysound('song.wav',snd_sync); //wenn Lied mit weiterem Programmablauf synchronisieren soll

end;
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Sa 13.05.06 16:20 
Danke,
cih versuch es mal ob es funktioniert

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
DaKirsche
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 187

Win XP Pro, SuSe Linux 7.3 - 10.2, Win 2k3 Server, Win 2000, Win NT 4.0
Delphi 2006 Pro, Java, HTML, SQL, PHP, CSS
BeitragVerfasst: Sa 13.05.06 16:28 
doppeleintrag...habs wieder gelöscht^^
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Sa 13.05.06 16:41 
Wo muss ich das eigentlich einfügen:

[quote="user profile iconDaKirsche"
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
uses mmsystem;

procedure TFOrm1.Button1Click(Sender : TObject);
begin
sndplaysound('song.wav',snd_async); //wenn Lied nicht mit weiterem Programmablauf synchronisieren soll

sndplaysound('song.wav',snd_sync); //wenn Lied mit weiterem Programmablauf synchronisieren soll

end;
[/quote]

der Fehler von vorhin kommt immer noch bloß dass die letzten 2 Zahlen statt 68 jetzt 70 sind

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
DaKirsche
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 187

Win XP Pro, SuSe Linux 7.3 - 10.2, Win 2k3 Server, Win 2000, Win NT 4.0
Delphi 2006 Pro, Java, HTML, SQL, PHP, CSS
BeitragVerfasst: Sa 13.05.06 16:54 
mmsystem musst du in die uses Liste im Kopfbereich deiner Unit eintragen.
Das sndplaysound(datei,snd_async); muss in eine Prozedur (z.B. FormCreate);
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Sa 13.05.06 17:10 
genau so hab ich es gemacht trotzdem kommt immer noch die Fehlermeldung

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: So 14.05.06 11:08 
Das Lied wird jetzt abgespielt aber im ersten Durchlauf ist das Programmfenster nicht erst im zweiten und es wird nur einmal wiederholt es soll aber in einer Endlosschleife abgespielt werden.
Was mache ich falsch:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.FormCreate(Sender: TObject);
begin
  mediaplayer1.Hide;
  sndplaysound('HintergrundMusik.wav',snd_sync);
  mediaplayer1.Open;
  mediaplayer1.Play;
  timer1.Interval := Liedlaenge * 1000;
  timer1.Enabled := true;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  timer1.Enabled := false;
  mediaplayer1.Stop;     {Stoppen}
  mediaplayer1.Close;    {Schließen, ganz WICHTIG!!! Sonst bekommst du nen Error}
end;

:?: :?: :?: :?: :?:

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.