| View previous topic :: View next topic |
| Author |
Message |
Never Again I post too much
Reputation: 0
Joined: 13 Jan 2007 Posts: 2000 Location: New Mexico
|
Posted: Sun Oct 14, 2007 2:57 pm Post subject: How to add Music to a Project? [Delphi] |
|
|
| Yes, I know I ask alot of questions. I want to make a project with all my favorite music but how do you have the song start when you click Button1?
|
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Sun Oct 14, 2007 3:03 pm Post subject: |
|
|
and
| Code: | procedure TForm1.Button1Click(Sender: TObject);
begin
PlaySound(PChar('logged.wav'),0,SND_ASYNC);
end; |
To play it once.
And SND_LOOP to loop it.
Stop loop with:
| Code: | procedure TForm1.Button2Click(Sender: TObject);
begin
PlaySound(nil,0,0);
end; |
|
|
| Back to top |
|
 |
Never Again I post too much
Reputation: 0
Joined: 13 Jan 2007 Posts: 2000 Location: New Mexico
|
Posted: Sun Oct 14, 2007 3:06 pm Post subject: |
|
|
| You don't have to specify a path where the .wav is at?
|
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Sun Oct 14, 2007 3:13 pm Post subject: |
|
|
| Quote: | procedure TForm1.Button1Click(Sender: TObject);
begin
PlaySound(PChar('logged.wav'),0,SND_ASYNC);
end;
...
|
but it has to be in the same folder with the program, but you can also use "C:\lolol\porn.wav", but this is just for .WAV files.
|
|
| Back to top |
|
 |
Never Again I post too much
Reputation: 0
Joined: 13 Jan 2007 Posts: 2000 Location: New Mexico
|
Posted: Sun Oct 14, 2007 3:16 pm Post subject: |
|
|
What if I put a folder called wav's and put them all in there, would it be :
| Code: | procedure TForm1.Button1Click(Sender: TObject);
begin
PlaySound(PChar('wav's/logged.wav'),0,SND_ASYNC);
end;
... |
??
|
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Sun Oct 14, 2007 3:22 pm Post subject: |
|
|
| Never Again wrote: | What if I put a folder called wav's and put them all in there, would it be :
| Code: | procedure TForm1.Button1Click(Sender: TObject);
begin
PlaySound(PChar('wav's/logged.wav'),0,SND_ASYNC);
end;
... |
?? |
Don't use '
Use ยด because this sign will end the 'lala' part if you understand what I mean.
But it would work to use a folder.
|
|
| Back to top |
|
 |
Never Again I post too much
Reputation: 0
Joined: 13 Jan 2007 Posts: 2000 Location: New Mexico
|
Posted: Sun Oct 14, 2007 3:26 pm Post subject: |
|
|
| Oh yeah, so just 'wavs/jessicasimpsonnaked.wav'??
|
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Sun Oct 14, 2007 3:30 pm Post subject: |
|
|
| Never Again wrote: | | Oh yeah, so just 'wavs/jessicasimpsonnaked.wav'?? |
Should work, if it doesn't work, use "\" instead if "/".
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sun Oct 14, 2007 3:30 pm Post subject: |
|
|
search for my music program. Read the source and you will learn
its in delphi btw
_________________
|
|
| Back to top |
|
 |
Never Again I post too much
Reputation: 0
Joined: 13 Jan 2007 Posts: 2000 Location: New Mexico
|
Posted: Sun Oct 14, 2007 3:41 pm Post subject: |
|
|
| Damn, it doesn't work. It might just be becuase most of the songs I have on my CP are .mp3's
|
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Mon Oct 15, 2007 4:29 am Post subject: |
|
|
| lolx people need TuT on using tmediaplayer.
|
|
| Back to top |
|
 |
|