Yeah I was right. Its because I am trying to play the file before the wav has loaded. Question is, how can I program it so that I can be sure the file has loaded and is ready to be played? I can't put sleep(2000) or something similar it just isnt good programming.