Hello,
try this:
- in your uses clause add mmsystem
- execute this line:
PlaySound(Pchar('filename.
it works with .wav files, maybe also with .mp3 ??
Main Topics
Browse All Topicshow can i make my programme play .wav and .mp3s ? Points easily negotiable.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
To play a .WAV just do as amebikes said.
To play an .MP3 have a look at the following sites:
http://www.undu.com/Articl
http://www.xaudio.com/
Cheers,
Alan
Hi...
To play an mp3 do this....
New project:
drop a TMediaplayer, a button and an OpenDialog comp.
add this code in the button Begin / End block
//USES MMSystem//
--------------------------
OpenDialog1.DefaultExt := 'mp3';
OpenDialog1.Filename := '*.mp3';
if OpenDialog1.Execute then
begin
MediaPlayer1.Filename := OpenDialog1.Filename;
MediaPlayer1.Open;
Mediaplayer1.play;
end;
end;
--------------------------
when you click the button, the OpenDialog box opens,
navigate to an mp3 file on your system and click OK,
play it!
easy as that. Have fun!
tongalite
your entire Unit should look like this:
--------------------------
unit Unit1;
interface
uses
Windows, Messages,MMSystem, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, MPlayer;
type
TForm1 = class(TForm)
MediaPlayer1: TMediaPlayer;
Button1: TButton;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender
begin
OpenDialog1.DefaultExt := 'mp3';
OpenDialog1.Filename := '*.mp3';
if OpenDialog1.Execute then
begin
MediaPlayer1.Filename := OpenDialog1.Filename;
MediaPlayer1.Open;
Mediaplayer1.play;
end;
end;
end.
--------------------------
I can give you a working Example for playing mp3's and wav's without TMediaPlayer and with full source code. It's a small example of using nothing from within windows like codecs or system dll's. You are independent :-)
Give me your email address an I will send it to you (hope you will give me the points *g).
Bye, TDS.
Here is the link. The source code for the DLL is written in C/C++ but can easy change the code (I hope)
http://www.tds-net.de/expe
All files should be included, if not mail me:
webmaster@tds-net.de
If you grade this question, please give me a "A" :-)
Bye, TDS.
You have 12 open questions, some of which date back to the year 2000. ADMINISTRATION WILL BE CONTACTING YOU SHORTLY. Moderators Computer101 or Netminder will return to finalize these if they are still open in 14 days. Experts, please post closing recommendations before that time.
Below are your open questions as of today. Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response. This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database. If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
--> Post comments for expert of your intention to delete and why
--> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.
For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchang
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process. http://www.experts-exchang
Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.
Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added. When you grade the question less than an A, please comment as to why. This helps all involved, as well as others who may access this item in the future. PLEASE DO NOT AWARD POINTS TO ME.
To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchang
http://www.experts-exchang
http://www.experts-exchang
http://www.experts-exchang
http://www.experts-exchang
http://www.experts-exchang
http://www.experts-exchang
http://www.experts-exchang
http://www.experts-exchang
To view your locked questions, please click the following link(s) and evaluate the proposed answer.
http://www.experts-exchang
http://www.experts-exchang
http://www.experts-exchang
***** E X P E R T S P L E A S E ****** Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
http://www.experts-exchang
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://www.experts-exchang
Moderators will finalize this question if in @14 days Asker has not responded. This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
Business Accounts
Answer for Membership
by: amebikesPosted on 2002-03-14 at 07:39:54ID: 6864843
Hello, wav'), 0, SND_FILENAME + SND_ASYNC);
try this:
- in your uses clause add mmsystem
- execute this line:
PlaySound(Pchar('filename.
it works with .wav files, maybe also with .mp3 ??