For Programmers: Free Programming Magazines  


Home > Archive > Delphi > May 2005 > Delphi 5 embedded WAV









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Delphi 5 embedded WAV
Robert Duchene

2005-05-05, 4:00 am

All,

I am wondering if there is a way of embedding .WAV, or any multimedia files
into the Delphi 5 program.

I am using the media player tool, however it always wants a file. I would
like to compile the sound files into my delphi exe.

Any suggestions?

Thanks,
Rob
robert.duchene@rogers.com


Jamie

2005-05-06, 4:01 am

Robert Duchene wrote:
> All,
>
> I am wondering if there is a way of embedding .WAV, or any multimedia files
> into the Delphi 5 program.
>
> I am using the media player tool, however it always wants a file. I would
> like to compile the sound files into my delphi exe.
>
> Any suggestions?
>
> Thanks,
> Rob
> robert.duchene@rogers.com
>
>

you can use the Playsound Api call and use the resource option
to play sound from your resource of the EXE file.
you can add the resource as a RAW data type. "RT_RAW"
in the Recourse you need to specify the name of the
resource which you create, the type which is RT_RAW and the
filename path from where it is.
at build time of y9our app, it will get compiled into the
resource of your app.
in your app you need to use the resource functions to find and
obtain the handle to it, then pass it to the Playsound function as a
resource which it will then simply play it, or you could read it from
resource into some fixed memory and still use the Playsound to play it.
etc..


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com