Play wave files

Hello all,
How can I play some sounds without actually creating and using wave files in disk?
I tried to pack the wave files together with the EXE.  However, when I need to use them, I have to write the wave files to disk first and load them afterwards.
In other words, how can I play wave files without the involvement of the disk at all.

Thanks in advance.

PS. I can't use third-party components due to some reasons.
Who is Participating?

Improve company productivity with a Business Account.Sign Up

Mohammed NasmanConnect With a Mentor Software DeveloperCommented:

  Read this article, I think it will be useful for you

Inside the EXE

Can you stream your WAV data into a TMemoryStream? You can then play them from there like this:

  wave : TMemoryStream;
  wave := TmemoryStream.Create;
  sndPlaySound(wave.Memory, snd_Memory + snd_Sync);

You'll need to get the data into the memorystream but the above code will play that no problem (just make sure you have mmSystem in your uses clause)

The Neil =:)
nytAuthor Commented:
Great...the webpage shows the way step by step.  I got it work easily.
Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.