Hi,
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()
{
while(1)
{
if(getch()=='w')
{
//Beep(1000,50);
PlaySound(_T("kick.wav"),NULL,SND_ASYNC|SND_FILENAME);
}
}
return 0;
}