• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 404
  • Last Modified:

How to preload tiny WAV for instant play?

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?
0
volking
Asked:
volking
  • 2
1 Solution
 
DimkovCommented:
0
 
volkingAuthor Commented:
@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.
0
 
DimkovCommented:
I think you should use direct sound for this task... which loads the wav i buffer.
Here is a link that can help you:
http://www.codeproject.com/cs/media/AmbientSounds.asp
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now