How to preload tiny WAV for instant play?

Posted on 2007-08-09
Last Modified: 2010-04-15
Winforms and C#

How do I preload a tiny WAV file into memory such that my program can play it instantly and repeatedly without having to read the disk each time?
Question by:volking
    LVL 3

    Expert Comment

    LVL 5

    Author Comment

    @DIMKOV - Nope. SoundPlayer doesn't work for this. I need a sound like like a rabbit bouncing, "boing". "boing". "boing".  or maybe a space alien shooting a phaser, "phzzz", "phzzz", "phzzz", "phzzz", "phzzz". It needs to play INSTANTLY. SoundPlay loads everytime it plays, RIGHT? So there's always a delay. Not much delay, but enough to be noticed.
    LVL 3

    Accepted Solution

    I think you should use direct sound for this task... which loads the wav i buffer.
    Here is a link that can help you:

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    prevent lose focus 6 49
    network + 7 58
    C# Winform panel within a panel 4 31
    Add Server Certificate in IIS from C# 6 28
    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now