Autor Beitrag
DelphiProgrammer97
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: Sa 02.01.10 13:50 
Hallo,

Um die Athmosphäre in einem meiner Projekte zu verbessern, würde ich sehr gerne Musik abspielen, wenn ich das Programm öffne

allerdings habe ich keinen blassen schimmer wie das funktioniert, und die suchfunktion hat mir auch nicht weiter geholfen

wäre vielleicht jemand so nett es mir hier zu zeigen?:D

Lg

DelphiProgrammer97
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 02.01.10 14:03 
Schau dir einmal die Funktion PlaySound an. ;-)
Damit kannst du das auch asynchron im Hintergrund laufen lassen.
DelphiProgrammer97 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: Sa 02.01.10 14:22 
irgendwie versteh ich das garnicht :(
turboPASCAL
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 193
Erhaltene Danke: 1

Win XP / Vischda
D6 PE / D2005 PE
BeitragVerfasst: Sa 02.01.10 14:30 
Dann nutze doch mal die Forensuche mit den Strichworten:
Suche in der Entwickler-Ecke PLAYSOUND
Suche in der Entwickler-Ecke MUSIK ABSPIELEN

_________________
Nein, ich bin nicht der turboPASCAL aus der DP, ich seh nur so aus... :P
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 02.01.10 14:57 
user profile iconDelphiProgrammer97 hat folgendes geschrieben Zum zitierten Posting springen:
irgendwie versteh ich das garnicht :(
Was denn daran nicht? :nixweiss:
Wie sollen wir helfen, wenn du da nicht genauer schreibst was du versucht hast und was das Problem ist?
DelphiProgrammer97 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: Sa 02.01.10 15:02 
naja ich möchte halt musik abspielen wenn sich mein programm öffnet mehr nicht
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 02.01.10 15:05 
Das ist klar, aber wo liegt bei PlaySound das Problem?
DelphiProgrammer97 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: Sa 02.01.10 15:06 
na was soll ich denn mit diesem wort anfangen,soll ich den dateiname eingeben oder was?

wenn ich PlaySound eingebe, steht da UUndefinierter Bezeichner: PlaySound
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 02.01.10 15:09 
Wo die Funktion deklariert ist, steht ja dabei:
Zitat:
Header Mmsystem.h
Du musst also nur Mmsystem in die uses oben schreiben.
Tilman
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1405
Erhaltene Danke: 51

Win 7, Android
Turbo Delphi, Eclipse
BeitragVerfasst: Sa 02.01.10 15:10 
Hi DelphiProgrammer, später wirst du mit solchen Anleitungen keine Probleme mehr haben. Für den Anfang gibts denke ich ne einfachere Lösung für dich:

1. Komponente tMediaPlayer (Spalte System in der Palette) aufs Form ziehen
2. FileName auf deine gewünschte Datei stellen
3. AutoOpen auf true stellen, damit die Musikdatei automatisch geladen wird
4. Visible auf False stellen, damit man den Mediaplayer nicht sehen kann
5. im OnShow-Eregnis vom Formular schreiben:
Mediaplayer1.play;

Die andern hauen mich jetzt vielleicht, aber vielleicht ist das ja das was du suchst. :-)

_________________
Bringe einen Menschen zum grübeln, dann kannst du heimlich seinen Reis essen.
(Koreanisches Sprichwort)
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 02.01.10 15:12 
user profile iconTilman hat folgendes geschrieben Zum zitierten Posting springen:
Die andern hauen mich jetzt vielleicht
*Bäng* *Bam* *Boing* :mrgreen:
Nein, im Ernst: So kann man es natürlich machen, aber ob das wirklich einfacher / sinnvoller ist als eine Zeile mit PlaySound in FormCreate / FormShow... :?:
DelphiProgrammer97 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: Sa 02.01.10 15:16 
Edit: Ok danke es geht jetzt :)
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Sa 02.01.10 15:25 
ausblenden Delphi-Quelltext
1:
  PlaySound('C:\datei.wav'0, SND_ASYNC or SND_FILENAME or SND_NODEFAULT);