Autor Beitrag
McFarlane
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68

WIN XP Prof.
Delphi 2005 PE, Turbo Delphi 2006, PHP (Eclipse)
BeitragVerfasst: Di 20.02.07 17:45 
Tach,
ich bin grad dabei nen Wecker zu programmieren. Nur wie kann ich einen Sound endlos abspielen?
Hab schon alles mögliche probiert, bin aber nicht auf eine Lösung gestoßen.
Plz help, McFarlane

_________________
21 ist nur die halbe Wahrheit...
Leuchtturm
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: Di 20.02.07 17:48 
Mit was spielst du den sound den ab :?:

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
McFarlane Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 68

WIN XP Prof.
Delphi 2005 PE, Turbo Delphi 2006, PHP (Eclipse)
BeitragVerfasst: Di 20.02.07 18:30 
Ups...
Mit TMediaPlayer
€dit: Hab ne Lösung gefunden:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
  player.Open;
  waittime.Interval := player.TrackLength[0];
  player.play;
  waittime.Enabled := true;


waittime isn Timer der bei OnTimer den Sound wieder abspielt.

_________________
21 ist nur die halbe Wahrheit...
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: Di 20.02.07 20:10 
Besser:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.FormCreate(Sender: TObject);
begin
  MediaPlayer1.Notify := True;
  MediaPlayer1.Open;
  MediaPlayer1.Play;
end;

procedure TForm1.MediaPlayer1Notify(Sender: TObject);
begin
  if MediaPlayer1.Position = MediaPlayer1.Length then
  begin
    MediaPlayer1.Rewind;
    MediaPlayer1.Play;
  end;
end;

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 20.02.07 22:08 
Fast:
Delphi-Hilfe:

Notify wirkt sich nur auf den Aufruf der nächsten Methode zur Steuerung des Media-Players aus. Soll die Eigenschaft Notify auch für weitere Methodenaufrufe gelten, muss sie nach jedem Aufruf neu gesetzt werden.

Notify muss also im OnNotify nochmal auf True gesetzt werden.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
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 21.02.07 13:28 
Nein. Ich habs ausprobiert [auch wenn es mich selbst gewundert hat].

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Odeng
Hält's aus hier
Beiträge: 14

Win XP
Delphi, Perl, VB, C++
BeitragVerfasst: Di 06.03.07 21:05 
Titel: PlaySound
Hey!

Hast du schonmal über PlaySound nachgedacht? Der/Die/Das kann das alles was du willst. Hier hast du die Möglichkeit den Sound einmal, zwei, drei, ...., unendlichmal abspielen zu lassen, Zudem kanst du bestimen, ob das Programm auf das Ende der Schleife warten soll oder ob der Sound im Hintergund abgespielt wird....

Grüße
Oliver

_________________
__________________
Es gibt nichts Gutes, außer man tut es :-)
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Di 06.03.07 21:10 
Um die Tontaube mit einer Flak abzuschießen: Suche bei Google BASS.DLL!

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Odeng
Hält's aus hier
Beiträge: 14

Win XP
Delphi, Perl, VB, C++
BeitragVerfasst: Di 06.03.07 21:20 
Wäre das nicht mit Kanonen auf Spatzen geschossen?

Grüße
Oliver

_________________
__________________
Es gibt nichts Gutes, außer man tut es :-)
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 06.03.07 21:26 
Hmmm, da haste wohl nur den Link geklickt und nicht den Beitrag gelesen^^

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Odeng
Hält's aus hier
Beiträge: 14

Win XP
Delphi, Perl, VB, C++
BeitragVerfasst: Di 06.03.07 21:34 
Naja, ich kenn die DLL und deshalb. Ich sag ja nicht, dass das nicht geht :-))

Schönen Abend
Oliver

_________________
__________________
Es gibt nichts Gutes, außer man tut es :-)
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Di 06.03.07 21:36 
user profile iconJayEff hat folgendes geschrieben:
Um die Tontaube mit einer Flak abzuschießen: [...]
user profile iconOdeng hat folgendes geschrieben:
Wäre das nicht mit Kanonen auf Spatzen geschossen?
:mrgreen: yup, wie schon gesagt.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.