Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Play waw file

Posted on 2000-03-04
8
Medium Priority
?
651 Views
Last Modified: 2008-03-17
How do I play a waw file from my program if the waw fille is not in the same directory as the program file?

For axample the file is located in:

C:\My program\Sounds
0
Comment
Question by:SwOoPe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 1

Accepted Solution

by:
delphiexpert earned 15 total points
ID: 2584431
I assume you mean wav file.
Just use the full path as well as the filename, eg
PlaySound('C:\My program\Sounds\sound.wav');


0
 

Author Comment

by:SwOoPe
ID: 2585264
The problem is that I dont know what path my program will be installd in during setup it kan be any thing.

C:\Music\Sound   or   D:\mp3\Sounds

How do I get the install dir + Sounds
0
 
LVL 1

Expert Comment

by:Indefrei
ID: 2585642
So,
this is not a q about playing sound
but about installing
while installing write your soundpath into the registry
and read it after starting your program
You should ask, how to do that
Regards
Indi
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Expert Comment

by:Indefrei
ID: 2585677
E.G.
Procedure TForm1.Button1Click(Sender: TObject);
var
    reg: TRegistry;
begin
           reg := TRegistry.Create;
           reg.RootKey := HKEY_CLASSES_ROOT;
           reg.LazyWrite := false;
           {Add Program Support}
           reg.OpenKey('.bor\shell\open\command', true);
           {Invoke the program passing the file name as the first parameter}
                      reg.WriteString('', 'C:\Program Files\Borland\Delphi 3\Project1.exe   %1');
                    {Add Icon Display}
            reg.CloseKey;
            reg.OpenKey('.bor\DefaultIcon', true);
           {Use the first icon in the executable to display}
            reg.WriteString('', 'C:\Program Files\Borland\Delphi
            3\Project1.exe,0');
            reg.CloseKey;
            reg.free;
end;

hope this gives you some guide lines...:-)
add registry to your uses clause...

                    uses
                     Windows, Forms,..., Registry;
0
 
LVL 1

Expert Comment

by:Indefrei
ID: 2585690
Hey, you bas....
right now i saw that you offered just 5 points
as we would say,
you should you what shame
sure, shame on you is shorter
0
 

Author Comment

by:SwOoPe
ID: 2585870
you should you what shame
sure, shame on you is shorter


?????????????????????????????

what the f**k is that ??
0
 
LVL 1

Expert Comment

by:delphiexpert
ID: 2586161
I think what he means to say is, try offering more points if you want to get a decent answer.
0
 
LVL 1

Expert Comment

by:AttarSoftware
ID: 2592233
PlaySound( ExtractFilePath( ParamStr( 0 ) + 'testsound.wav' ) ;

or it may be :

PlaySound( ExtractFilePath( ParamStr( 0 ) + '\testsound.wav' ) ;

Tim.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question