Go Premium for a chance to win a PS4. Enter to Win


Play wave files

Posted on 2001-07-12
Medium Priority
Last Modified: 2010-04-06
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.
Question by:nyt

Expert Comment

ID: 6276345
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 =:)
LVL 22

Accepted Solution

Mohammed Nasman earned 200 total points
ID: 6276371

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

Inside the EXE


Author Comment

ID: 6278170
Great...the webpage shows the way step by step.  I got it work easily.
Thank you.

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

782 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