Autor Beitrag
BlackPhantom
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 144

Win 2000, Win XP, UNIX
D7 Prof, C, HTML, VB 5
BeitragVerfasst: Sa 19.07.03 23:41 
Hi@all

Ich weiß ist ne Newbe-Frage aber ich komme da irgendwie nicht weiter.
Ich möchte zum Beipspiel, wenn ich auf nen Button clicke egal welchen, soll ein bestimmter Sound abgespielt werden.

Wie mache ich das?

thx4all@all

MFG
BlackP
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Sa 19.07.03 23:52 
Vielleicht mit dem MediaPlayer!?!

ausblenden Delphi-Quelltext
1:
2:
3:
MediaPlayer1.FileName:=Pfad+Dateiname;
MediaPlayer1.Open;
MediaPlayer1.Play;

_________________
Hasta La Victoria Siempre
BlackPhantom Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 144

Win 2000, Win XP, UNIX
D7 Prof, C, HTML, VB 5
BeitragVerfasst: So 20.07.03 00:02 
Ich dachte mir schon das so ne Antwort bzgl. des Media Players kommt, aber ich will die Files nicht mit dem Media Player öffnen. Geht es denn nicht anders ohne den Media Player?


MFG
BlackP
fcg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: So 20.07.03 13:24 
Wie willst du das denn bitteschön ohne MediaPlayer machen? :?: Du könntest dir evtl. eine andere vergleichbare Kompo runterladen, aber ohne Mediaplayer ist es verdammt schwierig (wenn es überhapt geht).

Es gibt noch so Töne, die über den Computerlautsprecher kommen wie z.B.:

ausblenden Delphi-Quelltext
1:
beep;					


aber ansonsten...

fcg

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: So 20.07.03 14:38 
Man kann aber auch mit einem simplen Befehl ganz einfach Sounddateien abspielen:

Eine einfache *.wav-Datei abspielen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
 uses
mmsystem

procedure TForm1.Button1Click(Sender: TObject);
begin
  sndPlaySound(PChar('C:\Datei.wav'),SND_SYNC);
end;

SND_SYNC  = Während die Datei abgespielt wird, steht die Anwendung
SND_ASYNC = Die Datei wird unabhängig vom Programm abgespielt.
SND_LOOP  = Immer wieder und immer wieder

procedure TForm1.Button2Click(Sender: TObject);
begin
  sndPlaySound(nil,0);
end;

Gefunden imd EASY DELPHI HELPER 2000

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
BlackPhantom Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 144

Win 2000, Win XP, UNIX
D7 Prof, C, HTML, VB 5
BeitragVerfasst: So 20.07.03 22:08 
Danke @Cruiser23,fcg,Terra23


Genau wonach ich gesucht habe :D

MFG
BlackP
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Mo 21.07.03 12:46 
Freut mich, das ich dir helfen konnte!

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!