Autor Beitrag
T1g3r
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57



BeitragVerfasst: Fr 06.05.05 15:21 
ich will einfach nen sound abspielen lassen der a.wav heißt!!!
der sound ist in dem gleichem ordner wie des prog!
Wie geht des gibt es einen befehl???


Zuletzt bearbeitet von T1g3r am Do 12.05.05 17:09, insgesamt 2-mal bearbeitet
mlspider
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33



BeitragVerfasst: Fr 06.05.05 22:35 
versuchs mal mit:

ausblenden Delphi-Quelltext
1:
mciSendString(PChar('open "'a.wav'" alias ' + fAliasName), nil00)					


in die uses gehört noch mmsystem.
mlspider
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33



BeitragVerfasst: Fr 06.05.05 22:52 
Sorry, habe mich jetzt selber etwas verarscht. So sollte es funktionieren:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure //(zB: TForm1.FormCreate(Sender: TObject);
        const
        FileName = 'a.wav';
        begin
        MCISendString(PChar('play ' + FileName), nil00);
        end;
feivel3333
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 190

W7
Delphi XE prof
BeitragVerfasst: Sa 07.05.05 00:56 
Sound abspielen geht auch mit
ausblenden Delphi-Quelltext
1:
SndPlaySound( 'SOUNDDATEI.WAV', SND_ASYNC );					

Dabei gibt es SND_ASYNC und SND_SYNC. Der Unterschied ist, dass bei ASYNC das Programm weiterläuft, während der Sound abgespielt wird, und bei SYNC das Programm wartet, bis der Sound zu Ende gespielt ist.

mmSystem ist auch hier in der Uses-Sektion einzufügen.

Moderiert von user profile iconmatze: Delphi-Tags hinzugefügt.
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 07.05.05 07:18 
SndPlaySound( 'SOUNDDATEI.WAV', SND_ASYNC ); Hat bei mir noch nie funktioniert. Da kommt zwar keine FehlerMeldung aber wenn ich auf den entsprechenden Button klicke nur ein 'beep'.
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Sa 07.05.05 09:01 
ausblenden Delphi-Quelltext
1:
PlaySound('newmessage',HInstance, snd_ASync or snd_Memory or snd_Resource);					


aus der ressource auch net ? (ok kommt aufn verwendungszweck an ^^)
T1g3r Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57



BeitragVerfasst: Mo 09.05.05 08:43 
wenn ich die sachen mache kommt immer

ausblenden Delphi-Quelltext
1:
[Error] URennen.pas(646): Unknown directive: 'SndPlaySound'					



als fehler warum?
feivel3333
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 190

W7
Delphi XE prof
BeitragVerfasst: Mo 09.05.05 08:48 
Hast du in der Uses-Sektion

mmSystem

eingefügt?
T1g3r Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57



BeitragVerfasst: Mo 09.05.05 09:19 
uses-system wo ist des :?:
feivel3333
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 190

W7
Delphi XE prof
BeitragVerfasst: Mo 09.05.05 13:10 
Nicht "System", sondern "Sektion" oder Bereich.
Ganz oben am Anfang in der Unit steht

USES ......, ...., und so weiter.

Dort muss es angefügt werden.
T1g3r Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57



BeitragVerfasst: Mo 09.05.05 15:23 
da kommt bei mir aber nen ganz anderer sound jetzt raus so ein "pep"
und net des was soll
feivel3333
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 190

W7
Delphi XE prof
BeitragVerfasst: Mo 09.05.05 17:44 
Was für ein Ton soll jetzt genau wo herauskommen? Sollen die Töne aus deinen Lautsprechern kommen, die über die Soundkarte laufen, oder willst du nur ein schlichtes Piep, das aus dem PC-Lautsprecher auf dem Mainboard kommt?
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mo 09.05.05 17:48 
seht ihr, das ist das von mir beschriebene Problem, mehr als n beep, kommt da nich.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mo 09.05.05 20:06 
habt ihr das schonmal so probiert:
ausblenden Delphi-Quelltext
1:
PlaySound(PChar('c:\wave.wav'), hInstance, SND_FileName or SND_ASYNC)					

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mo 09.05.05 20:10 
Jetzt kommt bei mir n peeb vom Mainboard.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Di 10.05.05 14:49 
mit dem code von mir ?
das kann aber eigendlich nicht sein.
existiert die wave datei auch ?
evtl kannste mal den code auf einem anderen rechner testen !

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Blackheart
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 164

ME
D3Prof.-D6Standard
BeitragVerfasst: Di 10.05.05 15:10 
Funktioniert (Getestet) Wav Datei in den Ordner der Exe

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:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, mmSystem;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  PlaySOUND(PChar('.\Test.wav'),hInstance,snd_ASync );
end;

end.
T1g3r Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57



BeitragVerfasst: Di 10.05.05 15:10 
bei mir war das problem einfach das die datei einfach anders hieß.
Ich hab die Datei a.wav genannt aber bei Win xp steht des .wav ja nicht mehr da!!!

So ich hab aber noch ne frage wie geht dass wenn ein lied wiederholt werden soll wenn es fertig ist und wie stopppe ich ein lied das läuft??

mfg Michel
Blackheart
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 164

ME
D3Prof.-D6Standard
BeitragVerfasst: Di 10.05.05 15:17 
Oder Mal in der Delphihilfe unter den Begriffen nachschlagen !

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
uses mmsystem;

begin
 {Folgende Flags können benutzt werden:
  SND_SYNC = Spielt den Sound ab, die Anwendung "steht"
  SND_ASYNC = Spielt den Sound ab, die Anwendung läuft weiter
  SND_LOOP = Spielt den Sound endlos}


  {Es können auch mehrere Flags kombiniert werden:}
  flag:=SND_SYNC or SND_LOOP;

  {Abspielen kann man einen Sound dann ganz einfach so:}
  sndPlaySound('sound.wav', Flag);

  {Um einen endlosen Sound zu stoppen, ruft die Funktion mit folgenden
  Parametern auf:}

  sndPlaySound(NIL,0);
end;
T1g3r Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57



BeitragVerfasst: Di 10.05.05 15:41 
kk ich hab die deutsch delphi-Hilfe nicht!!!
kennt jemand ne seite wo ich lieder als wav datei runterladen kann oder wo ich nen prog bekommen des mp3's in wav umwandelt???