Im trying to make a sysmple program that plays different .wav files when an appropiate key is pressed. Its going to be keyboard drumkit kind of thing,

anyway, ive got it to play the sounds, but they always seem to have a short delay, from when the key is pressed to when the sound is played. Ive checked the wav file in audacity, and theres no delay at the start, the sound plays right off,

could any give any ideas on how to solve this, ive also tryed this program with a Beep(1000,50); function, and it works perfectly, the exact speedy responce im after.

but the wav file is just very slow at responding,

heres the code, and also the wav file, please help!!

#include <iostream>
#include <windows.h>   
#include <TCHAR.H>
#include <conio.h>

int main()




  return 0;


Accessing sounds in memory will be quicker than loading them off disk each time.

SND_ASYNC is good if you want to play really long files, and you want to be getting on with something else in the meantime. If you just want to play a short 'beep', and have nothing else to do, then try it without this flag.

Hi, sorry, but im still learning so your going to have to explain more,

from reading this page,

i take it, all i have to to, is to write the following in the resource script,
soundName WAVE c:\sounds\kick.wav

and then access it as normal via


how do i access the resource script, the only thing i can find is a file called test.exe.embed.manifest, in the debug folder, in my project folder, and when i open it, its in hex, so how do i write that line up the top?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.