Play wave files

Posted on 2001-07-12
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
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

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 50 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
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 is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

724 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