If you are getting NULL returned it is because the program was unable to open the file.
This could be because
- You have the name of thje file wrong in the function call
- You have the path to the file wrong in the function call
- Some other program already has the file open in a mode that is incompatable with the open mode you are trying to use. i.e. someone has it opened for read and you are trying to open it for write.
It is nothing to do with the fact it's a wav file.