Board index » delphi » Playing a Sound (Wave file - but any sound will do)

Playing a Sound (Wave file - but any sound will do)

Hi

What else do I need to play a sound?

TIA

Wayne

  With MediaPlayer1 do
  begin
    FileName := 'c:\ThisSound.wav';
    DeviceType := dtWaveAudio;
    Open;
      Play;
    close;
    end;
  end;

 

Re:Playing a Sound (Wave file - but any sound will do)


Hmm, simply use of PlaySound won't doo ?
Quote
Wayne wrote:
> Hi

> What else do I need to play a sound?

> TIA

> Wayne

>   With MediaPlayer1 do
>   begin
>     FileName := 'c:\ThisSound.wav';
>     DeviceType := dtWaveAudio;
>     Open;
>       Play;
>     close;
>     end;
>   end;

Re:Playing a Sound (Wave file - but any sound will do)


Quote
"Maynard Philbrook" <jami...@mindspring.com> wrote in message

news:3E009F96.3324B5D2@mindspring.com...

Quote
> Hmm, simply use of PlaySound won't doo ?

It probably will but I can't get that to work either.

And for some reason my help file does not have 'PlaySound' in it.

Volume etc is on as the sounds play outside delphi :-)

TIA

Wayne

Quote

> Wayne wrote:

> > Hi

> > What else do I need to play a sound?

> > TIA

> > Wayne

> >   With MediaPlayer1 do
> >   begin
> >     FileName := 'c:\ThisSound.wav';
> >     DeviceType := dtWaveAudio;
> >     Open;
> >       Play;
> >     close;
> >     end;
> >   end;

Re:Playing a Sound (Wave file - but any sound will do)


 uses
  MMSystem;

  PlaySound('c:\WavFile.wav', 0, SND_FILENAME + SND_ASYNC);

Works for me.

Quote
"Wayne" <wayne.burr...@xtra.co.nz> wrote in message

news:Nb1M9.3080$kq6.65349@news.xtra.co.nz...
Quote
> "Maynard Philbrook" <jami...@mindspring.com> wrote in message
> news:3E009F96.3324B5D2@mindspring.com...
> > Hmm, simply use of PlaySound won't doo ?

> It probably will but I can't get that to work either.

> And for some reason my help file does not have 'PlaySound' in it.

> Volume etc is on as the sounds play outside delphi :-)

> TIA

> Wayne

> > Wayne wrote:

> > > Hi

> > > What else do I need to play a sound?

> > > TIA

> > > Wayne

> > >   With MediaPlayer1 do
> > >   begin
> > >     FileName := 'c:\ThisSound.wav';
> > >     DeviceType := dtWaveAudio;
> > >     Open;
> > >       Play;
> > >     close;
> > >     end;
> > >   end;

Other Threads